AWS Configuration Management & Automation Study Guide
Recommending the appropriate AWS solution to enable configuration management automation
AWS Configuration Management & Automation
This guide covers the strategic selection and implementation of AWS services to automate infrastructure and application configuration, specifically tailored for the Solutions Architect - Professional (SAP-C02) exam.
Learning Objectives
After studying this guide, you will be able to:
- Differentiate between AWS Systems Manager, AWS OpsWorks, and AWS Config for automation tasks.
- Design a remediation strategy for non-compliant AWS resources.
- Select the appropriate flavor of AWS OpsWorks based on existing CM tools (Chef vs. Puppet).
- Implement Infrastructure as Code (IaC) and Configuration as Code patterns to ensure operational excellence.
Key Terms & Glossary
- Configuration Item (CI): A record of a resource's configuration at a specific point in time, tracked by AWS Config.
- CMDB (Configuration Management Database): A repository that acts as a single source of truth for an organization's IT assets; AWS Config serves this role in AWS.
- Runbook: A predefined set of procedures (often in YAML/JSON) executed by AWS Systems Manager Automation to perform routine tasks.
- Recipe / Module: Code components used by Chef (Recipes) or Puppet (Modules) to define the desired state of a server.
- Drift: When the actual state of a resource deviates from its defined "intended" state (e.g., a manual change to a security group).
The "Big Idea"
In a cloud-native environment, manual configuration is a risk to both security and scalability. The "Big Idea" here is the shift from manual administration to Automated State Management. By using AWS Config to monitor compliance and AWS Systems Manager or OpsWorks to enforce state, you create a self-healing architecture that minimizes human error and ensures that every environment—from Dev to Prod—is identical and secure.
Formula / Concept Box
| Requirement | Recommended AWS Solution |
|---|---|
| Resource Compliance | AWS Config + SSM Automation |
| OS-level Patching | AWS Systems Manager (Patch Manager) |
| Existing Chef/Puppet | AWS OpsWorks (Chef Automate or Puppet Enterprise) |
| Hybrid Cloud CM | AWS Systems Manager (via SSM Agent) |
| Infrastructure Provisioning | AWS CloudFormation (IaC) |
Hierarchical Outline
- AWS Config: The Compliance Auditor
- Managed Rules: Predefined AWS best practices (e.g.,
s3-bucket-public-read-prohibited). - Custom Rules: Built using AWS Lambda or CloudFormation Guard (DSL).
- Remediation: Triggering SSM Automation Runbooks to fix non-compliant resources.
- Managed Rules: Predefined AWS best practices (e.g.,
- AWS Systems Manager (SSM): The Swiss Army Knife
- Automation: Low-code workflow execution for common tasks.
- State Manager: Maintains consistent OS configurations (antivirus, firewall rules).
- Patch Manager: Automates the lifecycle of OS security updates.
- AWS OpsWorks: The Managed CM Server
- OpsWorks for Chef Automate: Managed Chef server with premium features.
- OpsWorks for Puppet Enterprise: Managed Puppet environment.
- OpsWorks Stacks (Legacy): Layer-based modeling using Chef Solo recipes.
Visual Anchors
Choosing a Configuration Tool
Automatic Remediation Flow
\begin{tikzpicture}[node distance=2cm, every node/.style={draw, fill=blue!10, text width=2.5cm, align=center, rounded corners}] \node (config) {AWS Config detects non-compliance}; \node (event) [right of=config, xshift=2cm] {Trigger Remediation (SSM Runbook)}; \node (action) [right of=event, xshift=2cm] {Resource Reconfigured to Compliant State};
\draw[->, thick] (config) -- (event);
\draw[->, thick] (event) -- (action);
\node[draw=none, fill=none, below of=event, yshift=1cm] {\small \textit{e.g., AWS-DisableS3BucketPublicReadWrite}};\end{tikzpicture}
Definition-Example Pairs
- Managed Automation Runbook: A pre-built script by AWS to resolve common issues.
- Example: Using
AWS-TerminateEC2Instanceautomatically if an instance is found running an unapproved AMI.
- Example: Using
- Infrastructure as Code (IaC): Defining infrastructure using configuration files.
- Example: A CloudFormation template that defines a VPC, three subnets, and an RDS instance with encryption enabled.
- CloudFormation Guard: A policy-as-code tool used to validate templates before deployment.
- Example: A rule that prevents any CloudFormation template from being deployed if it defines an S3 bucket with
PublicReadaccess.
- Example: A rule that prevents any CloudFormation template from being deployed if it defines an S3 bucket with
Worked Examples
Example 1: Remediating S3 Public Access
Scenario: A developer accidentally makes an S3 bucket public.
- Detection: AWS Config rule
s3-bucket-public-read-prohibitedmarks the resource as Non-compliant. - Association: The rule is linked to the
AWS-DisableS3BucketPublicReadWriteautomation runbook. - Execution: AWS Config passes the bucket name to the runbook.
- Result: The runbook executes the
PutPublicAccessBlockAPI call, and the bucket is secured within seconds.
Example 2: Migrating On-Premises Configuration to AWS
Scenario: An enterprise uses Puppet Enterprise on-premises and wants to maintain their existing modules while moving to AWS.
- Solution: Use AWS OpsWorks for Puppet Enterprise.
- Implementation: Use the provided Starter Kit to upload existing Puppet modules.
- Benefit: AWS manages the Puppet Master server (patching/backups), while the team continues using familiar tools.
Checkpoint Questions
- Which service should you use to track the historical configuration changes of an EC2 instance's security group?
- What is the primary difference between OpsWorks for Chef Automate and OpsWorks Stacks?
- How can you validate a Terraform or Kubernetes configuration file against corporate compliance standards before deployment?
- Which SSM feature is best suited for ensuring that a specific version of antivirus software is installed on all instances?
[!NOTE] Answers: 1. AWS Config; 2. Chef Automate provides a fully-fledged managed Chef server, while Stacks is a legacy solution using Chef Solo; 3. AWS CloudFormation Guard; 4. SSM State Manager.
Muddy Points & Cross-Refs
- SSM vs. Config: This is often confusing. Remember: AWS Config is for checking/auditing (Is it compliant?), while SSM is for doing/acting (Apply this patch/run this script).
- OpsWorks Stacks Support: Note that OpsWorks Stacks is considered legacy and does not support the very latest OS releases. For modern workloads, prefer Chef Automate or Puppet Enterprise flavors.
- Cross-Ref: For more on security-specific triggers, see the AWS Security Hub documentation regarding "Custom Actions" and Amazon EventBridge integration.
Comparison Tables
| Feature | AWS Config | AWS Systems Manager | AWS OpsWorks |
|---|---|---|---|
| Primary Goal | Auditing & Compliance | Operational Management | Configuration Mgmt (Chef/Puppet) |
| Level of Action | Resource/API Level | OS/Instance Level | Application/Middleware Level |
| Trigger Mechanism | Configuration Changes | Manual or Scheduled | Lifecycle Events |
| Agent Required? | No | Yes (SSM Agent) | Yes (Chef/Puppet Agent) |
| Hybrid Support? | No (AWS Resources only) | Yes | Yes (Chef/Puppet only) |