Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mununki/ratelink-lambda-zappa
Serverless GraphQL API powered by Zappa
https://github.com/mununki/ratelink-lambda-zappa
Last synced: 10 days ago
JSON representation
Serverless GraphQL API powered by Zappa
- Host: GitHub
- URL: https://github.com/mununki/ratelink-lambda-zappa
- Owner: mununki
- Created: 2018-10-18T01:41:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T02:58:14.000Z (about 2 years ago)
- Last Synced: 2024-04-24T03:22:05.199Z (8 months ago)
- Size: 6.84 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Severless GraphQL API with Django and Graphene
## Setup Guide
1. Virtualenv with Python 3.6
```
$ python3.6 -m venv env_django-lambda
$ source env_django-lambda/bin/activate
```> Zappa currently supports only Python 3.6
2. Install requirements.txt
```
$ pip3 install -r requirements.txt
```3. Set up RDS in my_django_proejct/settings.py (using already existing RDS instance)
> postgreSQL
```python
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'db_name',
'USER': 'user_name',
'PASSWORD': 'rds_master_password',
'HOST': 'something.rds.amazonaws.com',
'PORT': '5432',
}
}
```4. Valid AWS account and Create IAM user with role for zappa
- Create IAM user for lambda
- Permissions policies
- AWSLambdaFullAccess
- IAMFullAccess
- AmazonAPIGatewayAdministrator
- AWSCloudFormationReadOnlyAccess
- Creating **custom policy** for only zappa
```
{
"Version": "2018-10-18",
"Statement": [
{
"Sid": "my_project_zappa_1",
"Effect": "Allow",
"Action": [
"cloudformation:CreateStack",
"cloudformation:CreateChangeSet",
"cloudformation:ListStacks",
"cloudformation:UpdateStack",
"cloudformation:DescribeStacks",
"cloudformation:DescribeStackResource",
"cloudformation:DescribeStackEvents",
"cloudformation:ValidateTemplate",
"cloudformation:DescribeChangeSet",
"cloudformation:ExecuteChangeSet"
],
"Resource": [
"*"
]
}
]
}
```5. Initializing Zappa
```
$ zappa init
```6. Edit zappa_settings.json
- add VPC config with subnet1, subnet2, securityGroupId of AWS
7. Deployment
```
$ zappa deploy dev
```