You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (AwsContactFormBackendStack
)
which contains a lambda function, API GW and necessary resources for it.
The cdk.json
file tells the CDK Toolkit how to execute your app.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilecdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
In the lambda
directory, we have the lambda function code written in Golang, along with the binary file.
The binary file is used in the CDK APP to deploy it to AWS.
In the contact-form-code
directory, we have an example of how the frontend is setting up a contact form, dealing with the fields, sending the data to API GW, and acting upon the response.
This repo is used as the reference in one of my blog post available here: https://raywontalks.com/contact-form-aws/