

AWS Ops Agent for FinOps is in preview release and is subject to change.

# Automating EBS optimization with AWS Compute Optimizer Automation

Ask the agent what [AWS Compute Optimizer Automation](https://docs.aws.amazon.com/compute-optimizer/latest/ug/automation.html) is eligible to act on in your account, what your automation rules cover, and what Automation has already done. Automation acts on EBS volumes in two ways: it cleans up unattached volumes, and it upgrades volume types from gp2 to gp3 or from io1 to io2. The agent quantifies the eligible opportunity with estimated monthly savings, reports your rules and their event history, drills into a failed event down to the step that failed, and simulates a rule you are considering before you create it.

The agent's access to Automation is **read only**. It does not create, modify, disable, or delete rules, start on-demand automation events, roll back a completed event, or change your enrollment. Use the Compute Optimizer Automation console for those actions. The agent gives you links to the relevant console pages.

**Note**  
AWS Compute Optimizer Automation is an AWS service that acts on your resources. It is not the same thing as the agent's own scheduled automations, which run agent tasks on a cadence. For those, see [Task management](task-management.md). "Compute Optimizer" on its own also refers to the recommendation service, whose output is described in [Surfacing cost optimization recommendations](optimization-recommendations.md).

## Before you begin
<a name="compute-optimizer-automation-access"></a>

Automation must be enabled on the account before the agent can read anything account-specific. Enrollment is per account and applies to every Region in the partition, and it is separate from your Compute Optimizer enrollment. For more information, see [Enabling Automation](https://docs.aws.amazon.com/compute-optimizer/latest/ug/automation-enable.html).

The agent also needs permission to read Automation enrollment, recommended actions, rules, and event history. For role configuration, see the [AWS Ops Agent for FinOps IAM setup guide](setting-up.md).

Questions about how the service works, such as what it does, how the execution window behaves, or how enablement works across an organization, do not require enrollment, and the agent answers them from AWS documentation.

## Ask the agent
<a name="compute-optimizer-automation-prompts"></a>
+ "Clean up unattached idle EBS volumes."
+ "Upgrade EBS volumes to newer volume types."
+ "Which EBS volumes are eligible for Compute Optimizer Automation cleanup or volume-type upgrades? Show estimated savings separately for each action."
+ "How much could Compute Optimizer Automation save me each month?"
+ "Show me my automation rules and what each one covers."
+ "Which rules run against account {{<account-id>}}?"
+ "Did my automation rule fire this week, and how many events failed?"
+ "Explain why automation event {{<event-id>}} failed in {{<Region>}}, using its event details and execution steps."
+ "Simulate the resources a proposed gp2-to-gp3 automation rule would match in {{<Region>}}. Do not create the rule."
+ "Has Automation deleted anything I can still roll back?"
+ "Is it safe to let Automation delete my unattached volumes?"

## Finding automation opportunities
<a name="compute-optimizer-automation-opportunities"></a>

Ask the agent how many resources Automation could act on and what that would save. The agent reports the eligible resource count and the estimated monthly savings separately for each action type, because the two have different safety stories. Unattached-volume cleanup takes a snapshot and then deletes the volume. Its savings estimate assumes a snapshot the full size of the volume, so actual savings can differ.

Automation eligibility and general optimization recommendations can cover different resources, so the agent reports the counts that Automation returns.

Eligibility and event reads are per Region. When you do not name a Region, the agent first uses Cost Explorer to determine which Regions your account has EC2 and EBS costs in, queries those, and tells you which Regions the answer covers. Every total it gives you is a total over the Regions it queried, and if a Region could not be reached the agent says so rather than presenting a partial total as the account total. Results cover only the accounts and Regions the agent can read.

## Reviewing your rules
<a name="compute-optimizer-automation-rules"></a>

Ask the agent to list your automation rules. It can report details about each rule, including name, status, action types, schedule (including timezone and execution window), scope, and ARN.

Rules are either **account rules**, owned by a single account, or **organization rules**, which target a list of accounts. Ask which rules run against a particular account and the agent distinguishes the two, including organization rules that target the account without being owned by it.

Organization-level questions have to be asked from the management account or a delegated administrator registered for Compute Optimizer Automation. If the agent cannot read an account's Automation data, it tells you that and where the question needs to be asked instead.

To change, disable, or re-enable a rule, the agent gives you a link to that specific rule in the console.

## Reviewing automation activity
<a name="compute-optimizer-automation-activity"></a>

Ask the agent what Automation has done. It reports event history and status counts, and can filter by time window or by status, such as failed events in the last month, or events for a specific account or Region. Event history covers the trailing year. Savings on events, including completed events, are reported as estimated savings, calculated at the time of the modification rather than billed amounts.

For a failed event, the agent reads the event's steps, names the step that failed, and gives the reason the service recorded. When you ask about a particular event, include its event ID and Region. An event ID does not identify its Region, so the agent asks for the Region if you leave it out.

## Rolling back a completed action
<a name="compute-optimizer-automation-rollback"></a>

Ask whether an action can be undone and the agent can answer from your own event history rather than in the abstract. Rollback requires the event to have completed successfully. Rolling back an unattached-volume cleanup creates a new volume, with a new volume ID, from the snapshot Automation took. Rolling back a volume-type upgrade changes the volume back to its previous type. The agent can list your rollback-eligible events and link you to the console to perform the rollback.

## Previewing a rule before you create it
<a name="compute-optimizer-automation-preview"></a>

Describe a rule you are considering, including action type, Regions, thresholds, and any tag or volume-type conditions, and the agent simulates it and reports how many resources it would act on and the estimated savings, without creating anything. If you are weighing several thresholds, the agent previews each candidate so you are comparing measured outcomes rather than guesses. Organization-wide previews run from the management or delegated administrator account; otherwise the agent previews at account scope and labels it as such.

Creating the rule is the next step, in the console. The agent gives you the create-rule link when the preview is done.

## Recommendations that Automation can act on
<a name="compute-optimizer-automation-recommendations"></a>

When you ask about cost optimization recommendations and some of them are ones Automation covers, such as unattached volume deletions or volume-type upgrades, the agent notes inline that Automation can handle them, with the count of resources Automation is actually eligible to act on. If a rule with that action type exists, the agent points you to the rule instead of proposing a new one, and suggests re-enabling it if it is disabled. A rule with matching action types can still exclude resources through its criteria, so unless the agent has checked those criteria, it says the rule might cover the resources. You only see this information if you have recommendations that are eligible for Automation.