This project is the implementation of the backend of cloud resume challenge .
- AWS API GATEWAY
- AWS LAMBDA FONCTION
- AWS DYNAMODB
- AWS SAM
- AWS CLOUDFORMATION
- PYTHON : boto3, pytest
- GITACTION
-
Prerequisites
- Have an AWS account
- Have a GitHub account
- Clone this project
- Install AWS Command Line Interface (CLI) and AWS SAM CLI locally
- Create an Amazon S3 bucket in your AWS account to store the build package for development
- Create an AWS user with access keys, and secret key that you will use for secret key in Git Action
-
Build your application
sam build
-
Local testing
If you want to test the application locally
-
Test the API Gateway locally
sam local start-api
-
AWS SAM launches a Docker container with a mock API Gateway endpoint listening on
localhost:3000
-
You can use Insomnia or Postman to test the endpoint
-
-
GitAction pipelines
In the directory
.github/workflows/sam-deploy
you will see Github CI/CD pipeline. The files are configured using a YAML file. This file configures what specific action triggers a workflows. In your case it is push on mainhttps://gist.github.com/mvincentbb/7ccdefa01f602a3298613db615486c59
- Replace
##stack-name
with a name of the stack that you want to create. This stack will appear in your Cloudformation console - Replace
##s3-bucket##
with the name of the S3 bucket previously created to store the deployment package. - Replace both
##region##
with your AWS Region.
- Replace
-
Configuring AWS credentials in GitHub
The GitHub Actions CI/CD pipeline requires AWS credentials to access your AWS account. The credentials must include AWS Identity and Access Management (IAM) policies that provide access to Lambda, API Gateway, AWS CloudFormation, S3, and IAM resources.
These credentials are stored as GitHub secrets within your GitHub repository, under Settings>Secrets . For more information, see “GitHub Actions secrets”.
In your GitHub repository, create two secrets named
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
and enter the key values. -
Deploy your application
git add . git commit -am "Configure pipeline for deployement" git push
- Cleanup
To remove the resources that you created in AWS, navigate to the CloudFormation console and delete the stack.
You can also use an AWS CLI command to remove the stack:
aws cloudformation delete-stack --stack-name ##stack-name
Replace ##stack-name
by the name of your stack
At the end of this project you will learn about serverless application, how to use AWS ressource to build your application especially AWS Serverless Application Model . You will also learn about unitest and GitAction workflows.