This project is a template for AWS AppSync operations.
- AWS AppSync
- AWS Lambda
- Amazon DynamoDB
- Serverless Framework for IaC.
- GitHub actions for CI/CD.
- Webpack for packaging code.
- ESLint for linting.
- This will install all the required dependencies.
- format all the files using ESLint
- Packages the code using WebPack
- This command will deploy the resources to AWS using dev credentials
.
├── .gitHub # CI/CD workflow for GitHub actions
├── Lambdas # NodeJs code for all 4 CRUD Lambdas, including dynamodb helper functions
├── mapping-templates # Mapping templates for getBlog query and create, update, delete mutations
├── Resources # AppSync mapping templates configuration and roles
├── schema.api.graphql # AppSync schema
├── serverless.yml # Serverless framework configuration file supporting IaC
├── serverless-appsync-api.yml # AppSync plugin configuration for data sources
├── LICENSE
└── README.md
The following is the list of steps that is executed as a part of the CI/CD setup:
- Store all account credentials in GitHub secrets to access them in environment without exposing. The AWS credentials will be used for deploying the application into your AWS account.
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
DEV_REGION: ${{secrets.DEV_REGION}}
PROD_REGION: ${{secrets.PROD_REGION}}
- Install serverless
- Install npm
- Build project using webpack
- Deploy to dev environment: Mumbai (ap-south-1)
- Deploy to prod environment: Oregon (us-west-2)