CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
  • Week 1
    • 1.AWS Infrastructure Through an Operator's Eyes: Regions, AZs, and the Boundary of Responsibility
    • 2.IAM Operator's Manual: Users, Groups, Roles, Policy Evaluation Algorithm
    • 3.Advanced IAM: Building Guardrails with Permission Boundary, SCP, and Identity Center
    • 4.AWS Organizations: How One Person Operates 100 Accounts
    • 5.Week 1 Consolidated Review: Revisiting the First Week Through Operator Scenarios
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
    • 1.Elastic Beanstalk and Five Deployment Policies: The True Cost of Zero Downtime
    • 2.CodeDeploy: The Decision to Deploy Code Only and AppSpec's 13-Stage Lifecycle
    • 3.EC2 Image Builder: The Operational Virtue of Golden AMI
    • 4.OpsWorks EOL and Launch Template: Mixed Instances Policy's True Value
    • 5.Week 7 Comprehensive Review: Scenario-Based Deployment and Provisioning Decision-Making
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← SOA-C02/Week 7/Day 5

Based on the SOA-C02 exam guide·Report an error

SOA-C02· AssociateWeek 7 · Day 5~41 min read

Day 5 - Week 7 Comprehensive Review: Scenario-Based Deployment and Provisioning Decision-Making

Week 7 examined "how to deploy safely" from five perspectives. Beanstalk's PaaS trade-offs, CodeDeploy's narrow responsibility (code only), EC2 Image Builder's immutable infrastructure enforcement, the OpsWorks-to-SSM paradigm shift, and Launch Template + Mixed Instances Policy balancing cost and availability. Though each section covered different tools, they share one fundamental question: "What trade-off is right for this workload?"

This section brings together the five core decision axes from the previous sections and presents 12 problem scenarios showing how SOA-C02 actually tests this material. The goal is not to memorize tables but to develop the decision-making intuition that determines "why A is correct and B is a trap." By reviewing this once more before the exam, the answers will naturally come to mind.

Five Decision Axes from Week 7, Reconsidered

All tools covered this week reduce to five decision axes:

Decision AxisQuestionWeek 7 Tool Mapping
Downtime allowed?Must it be zero, or is a few minutes acceptable?All at once vs Rolling vs Immutable
Temporary capacity cost?Is 2x acceptable, or minimize overhead?Rolling vs Immutable vs Blue-Green
Rollback speed?Immediate vs redeployment timeImmutable/Blue-Green vs Rolling
Infrastructure ownershipAuto-provisioned vs existing resourcesBeanstalk vs CodeDeploy vs CloudFormation
Change scopeCode only vs entire environment vs AMICodeDeploy vs Beanstalk vs Image Builder

With these 5 axes, you can decompose almost any scenario automatically. For example, "zero-downtime + minimal cost + existing EC2 infrastructure" initially seems ambiguous (CodeDeploy + Blue-Green vs Beanstalk + Rolling with batch?), but the "existing infrastructure" clue points clearly to CodeDeploy.

💡 Related Theory: This decision-axis approach mirrors the Architecture Decision Record (ADR) standard template. Michael Nygard's 2011 ADR format follows Context → Decision → Consequences, explicitly documenting trade-offs for each decision. Practicing scenario decomposition like an ADR is a core cloud architect thought pattern for both exams and real-world work.

Beanstalk vs CodeDeploy vs CloudFormation: Responsibility Boundaries Clarified

Decision CriteriaBeanstalkCodeDeployCloudFormation
Infrastructure creationAutomatic (EC2/ALB/RDS)External (user responsibility)Automatic (all resources)
Code deploymentIntegratedCore functionSeparate (custom resource)
Rollback scopeEntire environmentRevisionEntire stack
Deployment hooks.ebextensions, .platformAppSpec hooks (13 steps)UpdatePolicy + WaitCondition
Language awarenessYes (Node/Python/Java/...)No (language-agnostic)No (language-agnostic)
Use caseSimple web app PaaSExisting EC2/Lambda/ECS fleetComplete IaC

In production, you combine all three. CloudFormation provisions VPC/ALB/ASG infrastructure, CodeDeploy handles code on top of it, and Beanstalk is reserved for small workloads where you want infrastructure bundled with the application. Image Builder creates the AMI for the ASG.

Five Beanstalk Deployment Policies Reconsidered

PolicyDowntimeTemp CapacityTemp CostRollback SpeedRecommended Use
All at oncePresent0% (full stop)NoneRedeploy requireddev/staging
RollingNoneTemporarily reducedNoneRedeploy requiredProduction without traffic spikes
Rolling with batchNoneMaintainedBatch-onlyRedeploy requiredBalanced production
ImmutableNoneMaintained2xFast (old ASG survives)Production where stability is critical
Blue-Green (URL Swap)NoneMaintained2xImmediate (CNAME switch)Instant rollback required

Critical trap: "Blue-Green = instant 100% switchover" is incorrect. CNAME switch is instant, but DNS TTL means some users stay on the old environment during the window. Beanstalk's default CNAME TTL is 60 seconds, but some ISPs and internal DNS servers cache longer, so actual 100% switchover can take 5-30 minutes.

CodeDeploy Core Summary

EC2 hook sequence:

ApplicationStop → DownloadBundle(auto) → BeforeInstall → Install(auto) → 
AfterInstall → ApplicationStart → ValidateService
[Blue-Green only]
→ BeforeBlockTraffic → BlockTraffic(auto) → AfterBlockTraffic →
  BeforeAllowTraffic → AllowTraffic(auto) → AfterAllowTraffic

Deployment methods by compute platform:

  • EC2: In-place or Blue-Green (ALB Target Group switch)
  • Lambda: Alias weight gradual adjustment (Canary, Linear, AllAtOnce)
  • ECS: Blue-Green (two Target Groups + Production Listener + Test Listener)

Two auto-rollback triggers:

  • DEPLOYMENT_FAILURE: Hook failure/timeout (immediate detection)
  • DEPLOYMENT_STOP_ON_ALARM: CloudWatch Alarm occurrence (minimum 1-3 minute delay)

Image Builder + Golden AMI + SSM Parameter Pattern

[Image Builder Pipeline] (monthly cron)
        ↓
   Create new AMI
        ↓ (EventBridge)
[Lambda] → Update SSM Parameter
        /golden-ami/al2/latest = ami-XXXX
        ↓
[Launch Template]
   ImageId: '{{resolve:ssm:/golden-ami/al2/latest}}'
        ↓
[Auto Scaling Group]
   Next Instance Refresh or scale-out uses new AMI

The elegance of this pattern: reference indirection. If the Launch Template refers to an AMI via SSM Parameter instead of directly, you don't need to create a new Launch Template version each time the AMI changes. Just update the SSM Parameter; the next instance creation automatically uses the new AMI.

Launch Configuration → Launch Template Migration

ItemLC (deprecated)LT (standard)
Version managementNone$Latest, $Default, etc. aliases
Partial updatesImpossible (recreate)Possible
Mixed InstancesNot supportedSupported
SSM Parameter referenceNot supportedSupported ({{resolve:ssm:...}})
New EC2 featuresUnsupported (frozen)Supported
New console creationImpossible after 2022.12Standard

Mixed Instances Policy + Spot Strategy

MixedInstancesPolicy:
  LaunchTemplate:
    LaunchTemplateSpecification:
      LaunchTemplateName: web-lt
      Version: $Latest
    Overrides:
      - InstanceType: m5.large
      - InstanceType: m5a.large
      - InstanceType: m6i.large
  InstancesDistribution:
    OnDemandBaseCapacity: 2           # Minimum on-demand guaranteed
    OnDemandPercentageAboveBaseCapacity: 30
    SpotAllocationStrategy: capacity-optimized   # or price-capacity-optimized

Spot Allocation Strategy priority:

  1. capacity-optimized — Minimizes interruption risk (most workloads)
  2. price-capacity-optimized — Cost + capacity balance (added 2022)
  3. lowest-price — High interruption risk (not recommended)

Spot interruption graceful shutdown:

  • EventBridge Rule (EC2 Spot Instance Interruption Warning) → Lambda → ALB deregister + SSM Run Command for graceful shutdown signal
  • Or ASG Lifecycle Hook to buy time before termination
  • IMDS /latest/meta-data/spot/instance-action detects faster (~10 seconds) than EventBridge

OpsWorks → SSM Migration

OpsWorks Stacks EOL: May 26, 2024. AWS-recommended migration:

  • Run Command: One-off command execution
  • State Manager: Periodic desired state application (replaces Chef Solo)
  • Patch Manager: Automated patching
  • SSM Document aws:applyChefRecipes action: Reuse existing Chef cookbooks

Long-term, Image Builder-based immutable infrastructure is the recommended path.

Proton vs Service Catalog Positioning

ItemService CatalogAWS Proton
Target audienceIT users (general infra requests)Developers (entire service workflow)
IaCCloudFormationCloudFormation, Terraform
CI/CD integrationNone (separate)Built-in (CodePipeline)
AbstractionProduct (single stack)Environment + Service (separated)
Use case"Create one VPC for me""Git push my microservice → infra + CI/CD auto-provisioned"

💡 Related Theory: Proton is AWS's native implementation of Spotify's Backstage "Internal Developer Platform (IDP)" concept. It aligns with CNCF Platform Working Group reference architecture — Platform Engineers define the golden path, Developers self-serve within it.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

You need production deployment with zero downtime, maintaining capacity, and minimizing additional cost. Which Beanstalk deployment policy is best?

Question 2

You want to route 10% traffic to a new Lambda version for 5 minutes of validation, then 100% switchover. Operations team demands automatic validation and rollback. Best approach?

Question 3

In AppSpec.yml, which hook runs right after new version files are copied to the destination directory, where you set permissions, create symlinks, and substitute environment-specific config?

Question 4

Company wants to build a new Golden AMI monthly; new ASG instances should auto-use it without manual intervention. What's the AWS-recommended standard pattern?

Question 5

Beanstalk environment termination deleted the embedded RDS database and caused data loss. How to prevent this?

Question 6

Auto Scaling Group needs minimum 2 on-demand instances guaranteed, above that 30% on-demand + 70% Spot for cost reduction, and minimize Spot interruptions.

Question 7

CodeDeploy deployment should auto-rollback to previous version if CloudWatch HighErrorRate Alarm triggers. Configuration?

Question 8

Automate graceful shutdown (ALB Target Group deregister, complete pending requests, backup logs) 2 minutes before Spot instance interruption.

Question 9

OpsWorks Stacks reaches EOL May 26, 2024. Migrate existing Chef cookbook assets to AWS with minimal infrastructure management burden.

Question 10

Platform Engineering team building IDP where developers Git push and automatically get standard Fargate Service + ALB + RDS + CodePipeline provisioned. Best AWS-native tool?

Question 11

Apply new Launch Template version (new Golden AMI reference) to running ASG, safely gradually replace all instances, auto-rollback if CloudWatch Alarm triggers mid-process.

Question 12

ASG scale-out cold start (AMI fetch + cloud-init + app startup) takes 3-5 minutes; too slow for traffic spikes. Reduce to 30-60 seconds without major cost increase. Also, predictable patterns (weekday 09:00 spikes) need additional policy.

Closing Thoughts

Week 7 covered five seemingly different tools (Beanstalk, CodeDeploy, Image Builder, OpsWorks/SSM, Launch Template/ASG), but the core question remained constant: trade-offs across five axes. Downtime tolerance, temporary capacity cost, rollback speed, infrastructure ownership model, and change scope. Exam scenarios test these axes. Developing fast decomposition intuition — "which axis is decisive in this scenario?" — is stronger than memorizing tool names and hook sequences for both exams and real-world architecture.

Next week (Week 8) transitions to networking operations: VPC troubleshooting, Flow Logs, VPC Endpoints, Transit Gateway — 18% of the CloudOps exam domain. Deployment automation was "how to safely push code;" networking is "how to safely flow traffic."


🔮 Next Week Preview (Week 8 - VPC Networking Operations)

  • Day 1: VPC fundamentals — subnets, route tables, NACL vs Security Group core differences, IPv6 dual-stack
  • Day 2: VPC Flow Logs analysis, Traffic Mirroring, Reachability Analyzer for routing validation
  • Day 3: NAT Gateway, VPC Endpoint (Interface/Gateway), PrivateLink for secure inter-service communication
  • Day 4: Transit Gateway hub-spoke, Site-to-Site VPN, Direct Connect, Route 53 operations (Latency/Geolocation/Weighted routing)
  • Day 5: Week 8 review + 12 scenario problems

💡 Networking troubleshooting is the trickiest CloudOps domain. NACL vs SG stateless/stateful distinction, VPC Endpoint policies, Transit Gateway route precedence are high-frequency test topics.

PreviousOpsWorks EOL and Launch Template: Mixed Instances Policy's True ValueWeek 7 · Day 4Next The VPC as a Virtual Datacenter, and the Five Things Operators Get Confused About Every DayWeek 8 · Day 1

Official references

  • SOA-C02 official exam page(opens in a new tab)
  • AWS Systems Manager documentation(opens in a new tab)
  • AWS CodeDeploy documentation(opens in a new tab)
  • Amazon EC2 Auto Scaling documentation(opens in a new tab)
  • AWS Lambda documentation(opens in a new tab)
  • AWS CloudFormation documentation(opens in a new tab)

On this page

  • Five Decision Axes from Week 7, Reconsidered
  • Beanstalk vs CodeDeploy vs CloudFormation: Responsibility Boundaries Clarified
  • Five Beanstalk Deployment Policies Reconsidered
  • CodeDeploy Core Summary
  • Image Builder + Golden AMI + SSM Parameter Pattern
  • Launch Configuration → Launch Template Migration
  • Mixed Instances Policy + Spot Strategy
  • OpsWorks → SSM Migration
  • Proton vs Service Catalog Positioning
  • 12 Scenario Practice Problems
  • Closing Thoughts
  • Next Week Preview (Week 8 - VPC Networking Operations)