Skill 3.1.2

Create and manage AWS resources by using CloudFormation and the AWS CDK

Key Concepts

A CloudFormation template declares resources with parameters, mappings, conditions and outputs; intrinsic functions such as !Ref, !GetAtt, !Sub, !FindInMap and !ImportValue connect them. Stacks are updated through change sets that preview additions, modifications and replacements. Drift detection finds changes made outside CloudFormation; DeletionPolicy (Retain, Snapshot) and UpdateReplacePolicy, stack policies and termination protection prevent data loss. cfn-init, cfn-signal and a CreationPolicy configure instances and wait for them to report success.

The AWS CDK defines the same resources in TypeScript, Python, Java, C# or Go. Constructs (L1 raw resources, L2 resources with defaults, L3 patterns) are composed into stacks in an app. cdk bootstrap creates the staging bucket, ECR repository and roles once per account and Region; cdk synth produces CloudFormation templates; cdk diff compares; cdk deploy deploys through CloudFormation.