A basic setup for deploying lambda , apigateway and a dynamodb database using amazon cdk in golang.
This is what we deploy:
Cloudformation stack:
A simple user dynamodb table:
API gateway with the following API routes:
.. and a few lambda functions (check out lambda/api.go).
Setup:
- AWS account (a free account will work)
- Setup aws cli and cdk.
- cd into the lambda directory.
make build- cd back to root of the project.
cdk diffto check what is being deployed.cdk deploy
A lambda function to register and login users will be deployed. This lambda function sits behind amazon api gateway and stores data in a dynamodb database.
cdk deploydeploy this stack to your default AWS account/regioncdk diffcompare deployed stack with current statecdk synthemits the synthesized CloudFormation templatego testrun unit testscdk destroyto delete the stack.



