AWS - DevOps Engineer Professional Study Guide

    2: Configuration Management and Infrastructure as Code

    This chapter examines the AWS-native services and patterns that define, deploy, and govern infrastructure as code at professional scale. It covers AWS CloudFormation, the AWS Cloud Development Kit (AWS CDK), AWS SAM, StackSets, nested stacks, drift detection, change-set workflows, multi-account onboarding through AWS Organizations and AWS Control Tower, AWS Service Catalog product distribution, event-driven automation, and Systems Manager Automation runbooks for operational tasks at fleet scale.

    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_STACK with the original template to IMPORT_RESOURCE reconciliation 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-1 and eu-west-1 for 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.

    Sections in this chapter

    1. Free
    2. Free with account
    3. Free with account
    4. Free with account
    5. Free with account
    6. Free with account
    7. Free with account
    8. Free with account
    9. Free with account