Learning Objectives
By the end of this chapter, you will be able to:
- Define cloud infrastructure and reusable environments by using AWS CloudFormation, AWS CDK, and AWS SAM, including the application of security baselines to new accounts.
- Determine which AWS services are appropriate for IaC and centralize logging, monitoring, and identity across an organization.
- Determine a deployment strategy that is repeatable and reusable, including StackSets, nested stacks, and modules, while designing automated solutions for complex tasks and large-scale environments.
- Determine drift detection and remediation strategies and design solutions that manage large numbers of resources through AWS Systems Manager, AWS Config, and tagging strategies.
- Apply CI/CD principles to IaC and automate patching and configuration management at scale with Patch Manager, State Manager, and Run Command.
- Deploy automation to create, onboard, and secure AWS accounts in multi-account or multi-Region environments and configure event-driven automation with Amazon EventBridge and AWS Lambda.
- Automate account creation and configuration with AWS Organizations, AWS Control Tower, and AWS Service Catalog and write Systems Manager Automation runbooks for operational tasks.
- Implement multi-account governance with service control policies (SCPs) and guardrails.
Executive Summary
- AWS CloudFormation is the deterministic, declarative substrate; AWS CDK and AWS SAM are higher-level authoring layers that synthesize to CloudFormation templates, so every IaC choice reduces to a CloudFormation stack lifecycle.
- Reusable infrastructure is delivered through nested stacks (composition inside one parent stack), CloudFormation modules (registry-published reusable building blocks), and StackSets (one template, many accounts and Regions).
- Drift detection identifies out-of-band configuration changes; remediation strategies range from
UPDATE_STACKwith the original template toIMPORT_RESOURCEreconciliation and AWS Config remediation runbooks. - Account onboarding is anchored by AWS Organizations, productionized by AWS Control Tower landing zones, and templated for end users through AWS Service Catalog portfolios; SCPs and guardrails enforce the security perimeter.
- Fleet-scale operational work, including patching, configuration enforcement, ad-hoc remediation, and event-driven response, runs through AWS Systems Manager and Amazon EventBridge with deterministic Automation runbooks.
Assumptions
- Vocabulary from the prior chapter is reused without redefinition: AWS CodePipeline, AWS CodeBuild, AWS CodeDeploy, deployment configuration, AppSpec, alias, buildspec, Amazon ECR, Amazon S3 artifact bucket, and the deployment strategy taxonomy (in-place, blue/green, canary, rolling, immutable).
- Region examples use
us-east-1andeu-west-1for the management account and workload accounts, respectively. All ARNs and account numbers are illustrative. - Examples assume the management account has AWS Organizations enabled with all features and that AWS Control Tower has either been launched or is being launched as part of the scenario.
