docker compose up --build
Jump into cdk
container if you wish to run the commands below.
aws s3api create-bucket --bucket mybucket --region us-east-1 --endpoint http://${LOCALSTACK_HOSTNAME}:4566
or (use the awslocal tool)
awslocal s3api create-bucket --bucket mybucket --region us-east-1
aws s3 ls --endpoint http://${LOCALSTACK_HOSTNAME}:4566
or
awslocal s3 ls
cdklocal bootstrap aws://000000000000/us-east-1
Notice we're using cdklocal and not cdk in the above example with localstack
Check the new S3 bucket just created:
awslocal s3 ls
It should look something like:
cdk-hnb659fds-assets-000000000000-us-east-1
Make a project folder and hop inside
mkdir testapp && cd testapp
Init the testapp
cdklocal init testapp --language python
http://localhost:4566/\_localstack/health
Use cdklocal
for Localstack
cdk ls
list all stacks in the appcdk synth
emits the synthesized CloudFormation templatecdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk docs
open CDK documentation
- awslocal - https://github.com/localstack/awscli-local
- cdklocal - https://github.com/localstack/aws-cdk-local
- Your first AWS CDK app - https://docs.aws.amazon.com/cdk/v2/guide/hello_world.html
- Constructs Hub - https://constructs.dev/