code for article pfeilbr/aws-cdk-step-functions-playground
CDK app providing API Gateway endpoint to provision a CloudFormation stack. Endpoint is backed by step function that
initiates the create-stack
and polls (describe-stack
) on an interval for completion.
This can be used as a backend to provision a AWS CloudFormation Custom Resource Type that itself is backed by a set of AWS services.
see CDK stack components at lib/aws-cdk-step-functions-playground-stack.ts
Architecture
Dependencies
Demo
# install deps
npm install
# deploy
cdk deploy --force --require-approval never
# test with IAM auth (aws sigv4 request)
awscurl --service execute-api -X POST https://7t0zeiul1l.execute-api.us-east-1.amazonaws.com/prod/ -d '{"foo": "bar"}'
Welcome to your CDK TypeScript project!
This is a blank project for TypeScript development with CDK.
The cdk.json
file tells the CDK Toolkit how to execute your app.
Useful commands
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
Twitter • Reddit