SkillSprout
Chapter 3 · Lesson 3
Advanced
6 min read

Systems Manager Automation, Parameter Store and OpsCenter

Overview

Systems Manager Automation runs runbooks – multi-step, parameterised workflows such as "stop instance, snapshot volume, resize, start, verify". Where Run Command executes a script on one box, Automation orchestrates AWS API actions across resources, with approvals, branching and error handling.

Picture a checklist taped inside a server-room door. A human can follow it but may skip a step at 3 a.m. Automation is the same checklist executed by a robot, identically every time and logged for audit.

Alongside it, Parameter Store keeps configuration and secrets that scripts, templates and runbooks reference, and OpsCenter gathers operational issues (OpsItems) so they can be tracked and resolved with runbooks.

Key Concepts

  • Automation documents (runbooks) are YAML/JSON with steps such as aws:executeAwsApi, aws:runCommand, aws:changeInstanceState, aws:approve, aws:branch, aws:waitForAwsResourceProperty.
  • AWS provides hundreds of managed runbooks (AWS-RestartEC2Instance, AWS-CreateImage, AWS-UpdateLinuxAmi, AWSSupport-TroubleshootSSH, ...).
  • Automation runs under an AutomationAssumeRole (least privilege) and supports rate control and multi-account / multi-Region execution.
  • Triggers: console, CLI, EventBridge, Config remediation, maintenance windows, State Manager or CloudWatch alarms.
  • Parameter Store holds String, StringList, SecureString (KMS) parameters in hierarchies (/app/prod/db/host); standard (4 KB, free) and advanced tiers (8 KB, policies like expiration).
  • Parameters support versions and labels, and CloudFormation can resolve them ({{resolve:ssm:...}} or SSM parameter types).
  • OpsCenter creates OpsItems from CloudWatch alarms/EventBridge and links runbooks for resolution; Incident Manager adds on-call and response plans.
  • Change Manager adds approval workflow for operational changes; Change Calendar blocks changes during freeze windows.

Detailed Notes

Custom runbook example

Create an AMI, then replace instance type safely:

yaml
schemaVersion: "0.3"
description: Resize an EC2 instance with a safety backup
assumeRole: "{{ AutomationAssumeRole }}"
parameters:
  InstanceId: { type: String }
  NewType: { type: String, default: t3.large }
  AutomationAssumeRole: { type: String }
mainSteps:
  - name: backup
    action: aws:createImage
    inputs:
      InstanceId: "{{ InstanceId }}"
      ImageName: "pre-resize-{{ global:DATE_TIME }}"
      NoReboot: true
  - name: stop
    action: aws:changeInstanceState
    inputs: { InstanceIds: ["{{ InstanceId }}"], DesiredState: stopped }
  - name: resize
    action: aws:executeAwsApi
    inputs:
      Service: ec2
      Api: ModifyInstanceAttribute
      InstanceId: "{{ InstanceId }}"
      InstanceType: { Value: "{{ NewType }}" }
  - name: start
    action: aws:changeInstanceState
    inputs: { InstanceIds: ["{{ InstanceId }}"], DesiredState: running }
bash
aws ssm create-document --name Custom-ResizeInstance --document-type Automation \
  --document-format YAML --content file://resize.yaml
aws ssm start-automation-execution --document-name Custom-ResizeInstance \
  --parameters InstanceId=i-0abc,AutomationAssumeRole=arn:aws:iam::111122223333:role/AutoRole

Common managed runbooks

RunbookUse
AWS-RestartEC2InstanceReboot instance(s)
AWS-CreateImageGolden/backup AMI
AWS-UpdateLinuxAmiPatch and build new AMI
AWS-DisablePublicAccessForSecurityGroupConfig remediation
AWS-ConfigureS3BucketLoggingEnforce logging
AWSSupport-ExecuteEC2RescueRepair unreachable instances
AWS-AttachEBSVolumeOperational tasks

Automation vs Run Command vs Lambda

FeatureAutomationRun CommandLambda
Operates onAWS APIs and instancesInside instancesAnything via code
Multi-step with approvalYesNoCustom code
Max durationLong (hours)Per command (up to 48 h default timeout 1 h)15 min

Parameter Store

bash
aws ssm put-parameter --name /app/prod/db/password --type SecureString \
  --value 'S3cr3t!' --key-id alias/app-key
aws ssm get-parameter --name /app/prod/db/password --with-decryption
aws ssm get-parameters-by-path --path /app/prod --recursive --with-decryption
AspectParameter StoreSecrets Manager
CostStandard freePer secret per month
Automatic rotationNo (do it yourself)Yes (RDS and others)
Cross-account sharingAdvanced tier via RAMResource policy
Best forConfig values, AMI IDs, simple secretsDB credentials with rotation

Use IAM paths (arn:aws:ssm:*:*:parameter/app/prod/*) to scope access per environment. CloudFormation example:

yaml
DbHost: "{{resolve:ssm:/app/prod/db/host}}"
Password: "{{resolve:ssm-secure:/app/prod/db/password:1}}"

OpsCenter and Incident Manager

Alarms → EventBridge → OpsItem (with related resources, runbook suggestions). Resolve by running the attached Automation runbook; track MTTR. Incident Manager adds response plans, escalation and chat channels.

Troubleshooting Automation

SymptomCause
Step fails AccessDeniedAutomationAssumeRole lacks permission (also needs iam:PassRole for the invoking user)
Waits foreveraws:approve pending, or wait step without timeout
Not targeting instancesTag filters wrong or instances not SSM managed
PatternAction typesUse
Run commandsaws:runCommand, aws:executeScriptOS-level or Python/PowerShell logic
Call any APIaws:executeAwsApiStop instance, modify volume, tag
Wait and verifyaws:waitForAwsResourceProperty, aws:assertAwsResourcePropertyPoll until a state is reached
Branchingaws:branchConditional flow
Human gateaws:approveManual approval
Rate controlMaxConcurrency, MaxErrorsRun on many targets safely
yaml
schemaVersion: '0.3'
assumeRole: '{{ AutomationAssumeRole }}'
parameters:
  InstanceId: {type: String}
  AutomationAssumeRole: {type: String}
mainSteps:
  - name: stopInstance
    action: aws:changeInstanceState
    inputs: {InstanceIds: ['{{ InstanceId }}'], DesiredState: stopped}

Runbooks execute under an assume role (least privilege) and can be triggered by EventBridge, Config remediation, CloudWatch alarms, maintenance windows or the console. Change Manager adds approval workflows and Change Calendar blocks changes during freeze periods. Execution history and step output are in the Automation console and CloudTrail.

Real World Example

Scenario – disk-full self-healing. A CloudWatch alarm on disk usage creates an OpsItem and triggers an EventBridge rule that starts a custom runbook. The runbook uses Run Command to clean temp files, evaluates free space with a branch, and if still low increases the EBS volume with ModifyVolume and extends the file system. A final aws:approve step asks the on-call engineer to confirm before resizing production.

Mean time to resolution falls from 40 minutes to 4 minutes, and every action is in the Automation execution history for audit.

Architecture Diagram

Alarm to runbook remediation
Architecture
AWS Cloud
Alarmdisk > 90%
EventBridge
SSM Automationrunbook
Instance / EBS
Parameter Storeconfig
  1. 1A CloudWatch alarm detects the condition.
  2. 2EventBridge matches the alarm state change and starts an Automation execution.
  3. 3The runbook reads configuration from Parameter Store and acts on the instance and EBS volume.
  4. 4Results are recorded in execution history and the OpsItem is resolved.

Best Practices

  • ✓Prefer managed runbooks; write custom ones with least-privilege AutomationAssumeRole.
  • ✓Add approval steps and rate control for production-impacting runbooks.
  • ✓Store configuration in Parameter Store hierarchies and restrict IAM by path.
  • ✓Use SecureString with customer-managed KMS keys for sensitive parameters; use Secrets Manager when rotation is required.
  • ✓Connect alarms to OpsCenter so issues are tracked and linked to runbooks.

Common Interview Questions

Exam Tips

SOA-C03 focus

  • Multi-step operational workflow with approvals -> SSM Automation runbook.
  • Parameters encrypted with KMS -> SecureString; automatic rotation -> Secrets Manager.
  • Config non-compliance auto-fix -> remediation with Automation document.
  • Track operational issues -> OpsCenter (OpsItems); incident response -> Incident Manager.

Finished this lesson?

0 of 46 lessons done · 0% of the course