The AWS CDK code can be found in ./iac/awscdk
. The CDK App definition
that defines all of the Stacks is located in ./iac/awscdk/bin/awscdk.ts
.
The App instantiates the Stacks defined in ./iac/awscdk/lib/awscdk-stacks.ts
.
Follow instructions in the READMEs.
- make local-awscdk-bootstrap
- make local-awscdk-deploy
- make local-awscdk-invoke
- make local-awscdk-invoke-loop
- make local-awscdk-test
- make local-awscdk-clean
AWS targets
- make sbx-awscdk-bootstrap
- make sbx-awscdk-deploy
- make sbx-awscdk-clean
Follow the prerequisites in the main README.
- Install
cdklocal
. See LocalStack CDK CLI
npm install -g aws-cdk-local aws-cdk
make start-localstack
You need to do this once.
make local-awscdk-bootstrap
This will deploy the resources.
make local-awscdk-deploy
The Lambda is setup for hot reloading in this project on LocalStack by default. After everything is deployed by following one of complete IaC deployments above, you can work with the Lambda in hot-reload mode. See LocalStack Hot Reloading
Now, your DevX looks like a rapid TDD cycle. There's a test in auto_tests/test_apigw_name.py
.
Run watchman to do a build whenever code changes in the Lambda.
Change the Lambda in ./src/lambda-hello-name/src
. It'll recompile and redeploy on the fly. Then rerun the tests.
make watch-lambda
Then run the test(s)
make local-awscdk-test
make local-awscdk-invoke
make local-awscdk-clean
We use the same IaC pipelines to deploy to AWS! This is a very important point that LocalStack enables teams to test their IaC pipelines locally before ever deploying them to a live AWS environment.
However you set your credentials in your terminal, do it now.
Run the CDK bootstrap:
make sbx-awscdk-bootstrap
This will deploy the resources.
make sbx-awscdk-deploy
make sbx-awscdk-invoke
make sbx-awscdk-destroy