Please enable JavaScript.
Coggle requires JavaScript to display documents.
AWS CDK - Coggle Diagram
AWS CDK
Command & bootstrap
aws-cdk-lib (CLI & lib)
cdk init app
cdk synth
cdk bootstrap aws://<acc>/<region>
cdk deploy
cdk diff (diff local & cloud)
cdk destroy
Handon
cdk bootstrap (run 1 time / region / acc)
cdk synth
cdk deploy
cdk destroy
Constructs
AWS Construct Library -> Construct
3 level Constructs
L1, L2, L3
L1
CFN resources (CloudFormation Resource Spec)
start with Cfn
must explicit config
all resource properties
L2
intent-based API
convenient default
L3
Pattern
most command task
aws-apigateway.LambdaRestApi
Construct Hub (3rd)
Test (CDK assertions module)
fine-grained assertions
snapshot test
To import template
Template.fromStack(Stack)
Template.fromString(mystr)
Define cloud infra
using programming language
code (constructs) -> cloudformation template -> sync
(cdk synth)
use with SAM: cdk synth -> sam local invoke -t template.json myFunc