Reducing AWS Systems Manager Automation Costs: A Guide to Identifying High-Frequency Associations
Identifying High-Frequency Associations
As cloud operations teams scale infrastructure automation, AWS Systems Manager costs can grow with frequently running automation associations being the primary cost driver. Identifying these cost contributors is the first step toward optimization [1] .
Understanding the Cost Model
AWS Systems Manager Automation charges are billed per automation step executed beyond the free tier of 100,000 steps per account per month [1] . Additionally, each aws:executeScript action step incurs charges per second after consuming the free tier of 5,000 seconds monthly [1] . For customers who are new to Systems Manager Automation as of August 14, 2025, the Automation free tier is not available, and for customers already using Automation, the free tier of service ends on December 31, 2025 [2] .
Finding the Source of Costs
Investigation should begin in AWS Cost Explorer by filtering for
service: Systems Manager and usage types: AWS-Auto-Steps-Tier1 for step execution costs and AWS-Auto-ScriptDuration-Tier3 for script duration charges [3] . This view helps determine whether costs stem from the number of steps executed or the duration of script executions.The Discovery Script
After determining that Automation costs are a factor, the next step involves understanding which associations are responsible. An Automation runbook defines the actions that Systems Manager performs on managed instances and other AWS resources when an automation runs, with each runbook containing one or more steps that run in sequential order [5] .The following AWS CLI script generates a consolidated view of State Manager associations, helping identify automation documents that may be impacting costs:
for id in $(aws ssm list-associations --query "Associations[].AssociationId" --output text); do assoc_json=$(aws ssm describe-association --association-id "$id" \ --query '{AssociationId:AssociationDescription.AssociationId, Name:AssociationDescription.Name, Schedule:AssociationDescription.ScheduleExpression, Targets:AssociationDescription.Targets, LastExecutionDate:AssociationDescription.LastExecutionDate}' \ --output json) name=$(echo "$assoc_json" | jq -r '.Name') type=$(aws ssm describe-document --name "$name" \ --query "Document.DocumentType" --output text 2>/dev/null) echo "$assoc_json" | jq -r --arg type "$type" ' . + {Type:$type, TargetCount:(.Targets | map(.Values) | add | length)} | [.AssociationId, .Name, .Type, .Schedule, .TargetCount, .LastExecutionDate] | @tsv 'done This script retrieves key information for each association: the association ID, document name, document type (Automation or Command), schedule expression, target count, and last execution date. Execution is possible in AWS CloudShell.
Interpreting the Results
Output will appear similar to this:
a1b2c3d4-5678-90ef-gh12-3456789abcd AWS-UpdateWindowsAmi Automation rate(1 hour) 1 2025-11-12T03:00:00Z z9y8x7w6-v5u4-t3s2-r1q0-p9876543210 AWS-RunPatchBaseline Command cron(0 3 * * ? *) 50 2025-11-12T01:00:00Z Analysis should center on associations that exhibit these characteristics:
High-Frequency Schedules: Associations using short schedule expressions like rate(5 minutes) or cron(*/10 * * * ? *) execute frequently, multiplying step execution costs [7] .
Large Target Counts: If an association with an Automation runbook targets all instances in an account and regular launching of a large number of instances occurs, the runbook runs on each instance when it launches, potentially leading to elevated automation charges [7] .
Automation Document Type: Only associations with Type = Automation incur automation costs, as each step is charged at per step [8] . For multi-account automations, all steps executed in child accounts are counted only in the account that initiated the automation [8] .
While this script provides valuable insights into execution patterns, it does not include the number of steps executed within each automation.Using the information above, find the State manager association document in the AWS console to drill down into the automation execution history to review the number of executed steps.
Taking Action
Following the identification of cost drivers, evaluate and apply appropriate optimization strategies as needed
Reduce Execution Frequency: Evaluation should determine whether automations require execution as frequently as configured. Automation should focus on high-value, time-consuming, and complex activities that pose a high risk of human error [9] .
Adopt Event-Driven Automation: Instead of schedule-based execution, switching to event-driven automations using Amazon EventBridge ensures automations run only when needed rather than on fixed intervals [10] .
Review Necessity: Disabling or deleting associations that no longer serve critical operational needs can reduce costs [11] .
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article