This repo contains an example of a simple hello-world app using AWS Lambda, API Gateway and S3.
Check here if it works!
- Terraform v1.4.6
- Golang go1.19.9
- AWS Lambda
- API Gateway V2
- S3 bucket
- CloudWatch Logs
- Write the most simple Lambda function using Go 2. Test the function using the AWS console and AWS CLI
- Create TF configuration for the resources needed
- Troubleshoot & ensure it works when I hit the endpoint exposed by the API
- Figure out next steps for improving this demo
- For the purpose of making this example complete & working in 1 dev day, I chose to use some inspiration from OSS resources from Hashicorp and AWS official documentation websites.
- The default VPC and security groups are currently used, and changing that was considered outside of the scope for the purposes of this example.
- Add a CICD pipeline using GH Actions for the app deployment to the S3 bucket
- Add a CICD pipeline for the infra changes
- Add a Function URL
- Secure the endpoints exposed by the API Gateway
- allow only
GET/
actions - enable CORS
- allow only
- Limit the role permissions of the Lambda function to just the necessary ones
Anyone is welcome to contribute to and use this code.
Any incurred costs due to running costs for the AWS infrastrucutre are responsibility of the users, and not the authors.