CLD120 • AWS Academy Cloud Architecting

Module 10

Automating Your Architecture

Infrastructure as code · AWS CloudFormation · Elastic Beanstalk · AWS Systems Manager

Mesa Community College

Module Objective

Automate the provisioning and management of a cloud architecture using infrastructure as code and AWS management tools.

Modules 3–8All layers✓ built
Module 9Elasticity & HA✓ done
Module 10Automationyou are here
Module 11Caching
Module 12Decoupling
Module 13Serverless
Module 14Disaster recovery
Builds on Module 9: elasticity and high availability depend on infrastructure that can be provisioned and reproduced automatically.

Infrastructure as Code

Infrastructure as code (IaC): define VPCs, EC2 instances, RDS databases, and IAM roles in a version-controlled template instead of clicking through the console.

Manual ProvisioningInfrastructure as Code
Steps are undocumented unless written down separatelyThe template itself is the documentation
Hard to reproduce identically in another Region or accountDeploy the same template anywhere
Configuration drift is easy to introduceRe-deploying the template corrects drift
Note: IaC directly implements the Operational Excellence pillar’s “perform operations as code” principle (Module 2).

AWS CloudFormation

ConceptWhat It Means
TemplateJSON/YAML file describing desired resources and their configuration
StackResources created and managed together from one template
Change setA preview of what a template update would actually change, before applying it
AWSTemplateFormatVersion: "2010-09-09"
Description: Example - cafe website bucket
Resources:
  CafeWebsiteBucket:
    Type: AWS::S3::Bucket
    Properties:
      VersioningConfiguration:
        Status: Enabled
Example: a minimal YAML template
Template
→
Change set
review first
→
Stack updated
Change sets prevent surprises: see what CloudFormation will add, modify, or delete before it happens.

AWS Elastic Beanstalk Revisited

AWS Elastic Beanstalk
application code → running environment
Upload code; get a load-balanced, auto-scaled environment quickly
AWS CloudFormation
underneath
Provisions the actual infrastructure resources
CloudFormation: full control over every resource
Elastic Beanstalk: faster path, less control
Different levels of abstraction: Elastic Beanstalk trades some control for a faster path from code to a running environment.

AWS Systems Manager

Operations on already-running infrastructure:

Systems Manager FeatureWhat It Does
Run CommandExecutes commands across a fleet of instances without SSH access
Patch ManagerAutomates operating system and software patching
Parameter StoreCentralizes configuration values and secrets for applications to retrieve securely

CloudFormation

“How do I create this infrastructure?”

Systems Manager

“How do I operate and maintain it once it’s running?”

Key Terms

Infrastructure as code (IaC)
Defining infrastructure in a version-controlled template rather than provisioning it manually
CloudFormation stack
A collection of AWS resources created and managed together from one template
Change set
A preview of what a CloudFormation stack update would change before it’s applied
AWS Systems Manager
A service for operational tasks — patching, running commands, managing configuration — on running infrastructure

Review Questions

  1. What problem does infrastructure as code solve that manual console provisioning doesn’t?
  2. What is a CloudFormation stack, and what does a change set let an architect verify before applying it?
  3. How does AWS Elastic Beanstalk relate to AWS CloudFormation underneath?
  4. What is the difference in purpose between AWS CloudFormation and AWS Systems Manager?