This is a blank project for CDK development with TypeScript.
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 compilenpm run test
perform the jest unit testsnpx cdk deploy
deploy this stack to your default AWS account/regionnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template
This CDK project deploys a Lambda Function called "HelloWorld". The state machine just takes a name of a lambda function and tries to invoke it. If it can't, it will open the circuit. If it can, there is no change. Default TTL is 1 minute.
Good Execution
{
"targetLambda": "HelloWorld"
}
Bad Execution
{
"targetLambda": "Literally any function that either doesn't exist or the state machine does not have permission to invoke"
}
AWS CLI Good Command
aws [--profile ${profile}] stepfunctions start-sync-execution --step-function-arn ${arn} --input "{\"targetLambda\": \"HelloWorld\"}" | jq
AWS CLI Bad Command
aws [--profile ${profile}] stepfunctions start-sync-execution --step-function-arn ${arn} --input "{\"targetLambda\": \"DNE\"}" | jq