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:
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 }
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
| Runbook | Use |
|---|---|
AWS-RestartEC2Instance | Reboot instance(s) |
AWS-CreateImage | Golden/backup AMI |
AWS-UpdateLinuxAmi | Patch and build new AMI |
AWS-DisablePublicAccessForSecurityGroup | Config remediation |
AWS-ConfigureS3BucketLogging | Enforce logging |
AWSSupport-ExecuteEC2Rescue | Repair unreachable instances |
AWS-AttachEBSVolume | Operational tasks |
Automation vs Run Command vs Lambda
| Feature | Automation | Run Command | Lambda |
|---|---|---|---|
| Operates on | AWS APIs and instances | Inside instances | Anything via code |
| Multi-step with approval | Yes | No | Custom code |
| Max duration | Long (hours) | Per command (up to 48 h default timeout 1 h) | 15 min |
Parameter Store
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
| Aspect | Parameter Store | Secrets Manager |
|---|---|---|
| Cost | Standard free | Per secret per month |
| Automatic rotation | No (do it yourself) | Yes (RDS and others) |
| Cross-account sharing | Advanced tier via RAM | Resource policy |
| Best for | Config values, AMI IDs, simple secrets | DB credentials with rotation |
Use IAM paths (arn:aws:ssm:*:*:parameter/app/prod/*) to scope access per environment. CloudFormation example:
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
| Symptom | Cause |
|---|---|
| Step fails AccessDenied | AutomationAssumeRole lacks permission (also needs iam:PassRole for the invoking user) |
| Waits forever | aws:approve pending, or wait step without timeout |
| Not targeting instances | Tag filters wrong or instances not SSM managed |
| Pattern | Action types | Use |
|---|---|---|
| Run commands | aws:runCommand, aws:executeScript | OS-level or Python/PowerShell logic |
| Call any API | aws:executeAwsApi | Stop instance, modify volume, tag |
| Wait and verify | aws:waitForAwsResourceProperty, aws:assertAwsResourceProperty | Poll until a state is reached |
| Branching | aws:branch | Conditional flow |
| Human gate | aws:approve | Manual approval |
| Rate control | MaxConcurrency, MaxErrors | Run on many targets safely |
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
- 1A CloudWatch alarm detects the condition.
- 2EventBridge matches the alarm state change and starts an Automation execution.
- 3The runbook reads configuration from Parameter Store and acts on the instance and EBS volume.
- 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

