

# Apply optimization recommendations using Automation
<a name="automation"></a>

Automation is a feature within AWS Compute Optimizer that enables you to apply optimization recommendations to your AWS resources, which can help you reduce cost and improve performance. You can apply recommended actions directly or create automation rules that implement recommendations on a recurring schedule when they match your specified criteria. With automation rules, set criteria such as AWS Region and Resource Tags to target specific geographies and workloads. Configure rules to run daily, weekly, or monthly, and Compute Optimizer continuously evaluates new recommendations against your criteria. Track automation events over time, examine detailed step history, estimate savings achieved, and reverse actions directly from Compute Optimizer when needed.

# Enabling Automation
<a name="automation-enable"></a>

When you access the Automation section of the Compute Optimizer console for the first time, you're asked to enable the feature using the account that you’re signed in with. You can also opt in using the Compute Optimizer Automation API, AWS Command Line Interface (AWSCLI), or SDKs.

By enabling this feature, you authorize Compute Optimizer to implement optimization recommendations by managing AWS resources in your account. This includes creating Amazon EBS snapshots, deleting EBS volumes, and modifying EBS volumes. In the future, AWS may expand the types of optimization recommendations that AWS Compute Optimizer can implement and the AWS resources it can manage. 

To enable Automation, you need specific permissions to update the Automation enrollment configuration and create the necessary service-linked role. For more information on service-linked roles, see [Using service-linked roles for AWS Compute Optimizer](using-service-linked-roles.md).

**To enable Automation**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose any page under the **Automation** section.

1. On the feature landing page, choose **Enable Automation**.

1. When prompted, review the note on service-linked role permissions and choose **Enable Automation**.

To enable Automation using IAM policies, see [Enabling Automation](#automation-enable).

If you're enabling Automation for member accounts in your organization, the management account also needs permissions to associate and disassociate accounts. These permissions allow the management account to enable Automation for member accounts and configure whether the management account can implement optimizations on behalf of the member account. For more information, see [Enabling Automation for your organization](automation-org.md). 

## Policy to enable Automation for your account
<a name="policy-automation-enable-coa"></a>

The following policy statement enables Automation for your account.

```
{
    "Version": "2012-10-17",                   
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "iam:CreateServiceLinkedRole",
            "Resource": "arn:aws:iam::*:role/aws-service-role/aco-automation.amazonaws.com/AWSServiceRoleForComputeOptimizerAutomation",
            "Condition": {"StringLike": {"iam:AWSServiceName": "aco-automation.amazonaws.com"}}
        },
        {
            "Effect": "Allow",
            "Action": [
                "iam:PutRolePolicy", 
                "iam:AttachRolePolicy"
            ],
            "Resource": "arn:aws:iam::*:role/aws-service-role/aco-automation.amazonaws.com/AWSServiceRoleForComputeOptimizerAutomation"
        },
        {
            "Effect": "Allow",
            "Action": "aco-automation:UpdateEnrollmentConfiguration",
            "Resource": "*"
        }
    ]
}
```

# Enabling Automation for your organization
<a name="automation-org"></a>

When you enable Automation for your organization’s management account, you can also configure Automation for your organization’s member accounts, enabling centralized implementation of optimization actions across your organization. This centralized approach can help you optimize for cost and performance at scale.

## Policy to enable Automation across your organization
<a name="automation-enable-org-coa"></a>

The following policy statement enables Automation across your organization.

```
                {
    "Version": "2012-10-17",                   
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "iam:CreateServiceLinkedRole",
            "Resource": "arn:aws:iam::*:role/aws-service-role/aco-automation.amazonaws.com/AWSServiceRoleForComputeOptimizerAutomation",
            "Condition": {"StringLike": {"iam:AWSServiceName": "aco-automation.amazonaws.com"}}
        },
        {
            "Effect": "Allow",
            "Action": [
                "iam:PutRolePolicy", 
                "iam:AttachRolePolicy"
            ],
            "Resource": "arn:aws:iam::*:role/aws-service-role/aco-automation.amazonaws.com/AWSServiceRoleForComputeOptimizerAutomation"
        },
        {
            "Effect": "Allow",
            "Action": "aco-automation:UpdateEnrollmentConfiguration",
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": "aco-automation:AssociateAccounts",
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": "aco-automation:DisassociateAccounts",
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": "aco-automation:ListAccounts",
            "Resource": "*"
        }
    ]
}
```

## Trusted access for AWS Organizations
<a name="automation-org-access"></a>

You must have trusted access enabled to manage automation for your member accounts. When you opt in to Compute Optimizer using your organization's management account and include all member accounts, trusted access is automatically enabled. This allows Compute Optimizer to analyze resources and generate recommendations for member accounts. Trusted access also allows Compute Optimizer to implement recommendations for member accounts that have also enabled the Automation feature.

Compute Optimizer verifies that trusted access is enabled each time you access recommendations or apply recommendations for member accounts. If you disable trusted access, the management account loses access to recommendations and automation for your organization's member accounts. To re-enable trusted access, opt in to Compute Optimizer again using your organization's management account and include all the member accounts. For more information, see [Opting in to AWS Compute Optimizer](https://docs.aws.amazon.com/compute-optimizer/latest/ug/account-opt-in.html). For more information about AWS Organizations trusted access, see [Using AWS Organizations with other AWS services](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) in the AWS Organizations User Guide.

## Configure automation for member accounts
<a name="automation-org-configure"></a>

To enable Automation for member accounts, the management account needs permissions to associate and disassociate accounts. These permissions allow the management account to enable Automation for member accounts and configure whether the management account can implement optimizations on behalf of member accounts. For more information , see [Policy to enable Automation across your organization](security-iam.md#automation-enable-org).

Once a member account is associated, the management account or delegated administrator can view and apply recommended actions to the member account. When you associate a member account, its organization rule mode is automatically set to Any Allowed, which permits the management account to create Automation rules that automatically apply actions to that account. If the member account has not previously enabled the Automation feature, the association process automatically enables it.

**To enable Automation for member accounts**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Account management** under the **Preferences** section.

1. Choose the **Automation** tab.

1. Search for the account using its account Id.

1. Select the account and choose Add. You can enable Automation for up to 50 accounts at a time.

## Organization rule mode
<a name="automation-org-rule"></a>

This setting controls whether the management account can implement automated optimization actions for the member account. When set to Any Allowed, the management account can directly implement recommended actions or create Automation rules that apply to the member account. When set to None Allowed, only the member account can act on its own recommendations, and management account rules will not apply. When you enable Automation for a member account, its organization rule mode is automatically set to Any Allowed.

Organization rules targeting a member account automatically start or stop applying based on the organization rule mode setting. Rules apply when the mode is set to Any Allowed and stop applying when set to None Allowed. If you change the mode to None allowed, any in-progress automation steps initiated by organization rules will continue to completion, but no new automation steps will be triggered by organization rules for that account.

**To configure organization rule mode for member accounts**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Account management** under the **Preferences** section.

1. Choose the **Automation** tab.

1. Select the accounts that you want to configure.

1. Choose **Actions** and select `Allow organization rules `or `Disallow organization rules`. You can select and update the configuration for up to 50 accounts at a time.

# Recommended actions
<a name="automation-rec"></a>

Recommended actions are optimization opportunities that you can implement through Compute Optimizer. They are a subset of Compute Optimizer's recommendations. You can view and apply each recommended action directly or create automation rules to implement them on a recurring schedule when they match your specified criteria.

# Viewing recommended actions
<a name="automation-rec-view"></a>

The Recommended actions page displays a summary of your recommended actions and a table with details for individual actions. Recommended actions help you optimize your resources for performance and cost savings.

**Note**  
Your organization’s management account and delegated administrator can view recommended actions for member accounts with Automation enabled and configured to allow centralized optimization. For more information, see [Enabling Automation for your organization](automation-org.md).

**To access recommended actions**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Recommended actions** under the **Automation ** section.

1. You can perform the following actions on the **Recommended actions** page:

   - View recommended actions.

   - Filter recommended actions by one or more properties such as AWS Region or Resource Tag key-values.

   - Select the recommended actions that you want to apply.

   - View a summary of the estimated monthly savings for your selected recommended actions and the total opportunity available based on your filters.

   - Create automation rule from your selected filters. This pre-fills the rule creation form with your selected filters in the recommended actions table.

## Recommended actions summary
<a name="automation-rec-view-summary"></a>

This section of the Recommended actions page summarizes the estimated monthly savings for your selected recommended actions and the total opportunity available based on your filters. You can select and apply up to 10 actions at a time.

## Recommended action types
<a name="automation-rec-view-type"></a>

In the recommended actions table, you will find a list of optimization opportunities. The following recommended action types are supported:
+ Snapshot and delete unattached EBS volumes: This action is recommended for volumes unattached from EC2 instances for 32 or more days. Compute Optimizer creates a snapshot to back up your data before deleting the volume. For more information about this recommendation criteria, see [Idle criteria per resource](https://docs.aws.amazon.com/compute-optimizer/latest/ug/view-idle-recommendations.html#idle-criteria).
+ Upgrade EBS volume type: This action is recommended for volumes using previous generation volume types. Upgrading to newer generation volume types, such as gp3 and io2, provides better performance and cost efficiency with improved IOPS and throughput capabilities at lower prices. 

There are several considerations when applying recommended actions:
+ The estimated monthly savings considers the snapshot cost based on the volume's provisioned size. Actual snapshot cost depends on the incremental EBS snapshot size. 
+ When Compute Optimizer implements recommended actions that involve creating EBS snapshots, it automatically applies an AWS-generated tag to each snapshot. The tag key is `aws:compute-optimizer:automation-event-id`, and its value contains the unique identifier of the corresponding automation event. Compute Optimizer applies this tag to EBS snapshots created on or after February 24, 2026.
+ Amazon EBS supports up to four Elastic Volumes modifications per volume within a rolling 24-hour period. Volume modifications applied through Compute Optimizer count toward this limit. After Compute Optimizer completes a volume modification, you can initiate additional modifications as long as the total number of modifications remains within the limit. For more information, see the [Amazon EBS User Guide](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modify-volume.html).

## Estimated monthly savings
<a name="automation-rec-savings"></a>

**Estimated monthly savings (after discounts)**

This column in the recommended actions table displays the estimated monthly savings from implementing the recommended action. If you have savings estimation mode enabled, the estimated monthly savings include your specific discounts. To receive recommended actions that include your specific discounts, enable the savings estimation mode preference. For more information, see Savings estimation mode.

**Note**  
If you don't enable the savings estimation mode preference, this column displays estimated monthly savings based on On-Demand pricing.

**Estimated monthly savings (On-Demand)**

This column in the recommended actions table displays the estimated monthly savings from implementing the recommended action. The estimated monthly savings calculation is based on On-Demand pricing.

# Apply recommended actions
<a name="automation-rec-apply"></a>

You can select up to 10 recommended actions at a time to apply. Once you apply the recommended action, it will be removed from the Recommended action page and an automation event will be created. You can view and monitor the status of the action in the [Automation events](automation-events.md) page. Automation events awaiting execution will be in Ready status. You can have up to 100 automation events in Ready status per account per region.

**To apply recommended actions**

1. On the **Recommended actions** page, select up to 10 recommended actions that you want to apply.

1. Choose **Review and apply**. You will be able to review and confirm your selection on the next page before implementing actions.

1. Review your selection. You can remove selected recommended by clicking on the in-line remove icon.

1. Choose **Confirm and apply**.

1. When prompted to confirm, type `“confirm”` and choose **Apply changes**.

# Automation rules
<a name="automation-rules"></a>

Automation rules automatically implement recommended actions based on your defined criteria and schedule. Automation rules are global resources that manage automated actions across all AWS Regions where Compute Optimizer Automation is available. You can create, update, and delete automation rules from any AWS Region where Compute Optimizer Automation is available.

## Rule type
<a name="automation-rules-type"></a>

There are two types of rules:
+ Account rules: Rules that apply recommended actions only to your account.
+ Organization rules: Rules that centrally apply recommended actions across member accounts. 

**Note**  
Only the management account or delegated administrator can create organization rules. You can only select member accounts with Automation enabled and organization rules allowed can be selected for the rule to apply. Member accounts can view the details of organization rules that apply to their account but cannot edit them. Organization rules can be configured to apply before or after member account rules.

## Rule criteria
<a name="automation-rules-criteria"></a>

When configuring a rule, choose the recommended action types you want your rule to implement, such as snapshot and delete unattached Amazon EBS volumes and upgrade Amazon EBS volume type. Refine your selection using criteria such as AWS Region and Resource Tags. Then preview the current matching recommended actions to validate your criteria.

**Important**  
If you don't specify rule criteria, Compute Optimizer applies all the selected recommended actions types in the accounts you select in your rule scope, including recommended actions in all AWS Regions where Compute Optimizer Automation is available. 

The following recommended action attributes are currently supported as criteria for automation rules:


| Attribute | Operator | Field type | 
| --- | --- | --- | 
|  Current volume size (GiB)  |  `NumericEquals \| NumericNotEquals \| NumericLessThan \| NumericLessThanEquals \| NumericGreaterThan \| NumericGreaterThanEquals`  |  Integer  | 
|  Current volume type  |  `StringEquals \| StringNotEquals \| StringEqualsIgnoreCase \| StringNotEqualsIgnoreCase \| StringLike \| StringNotLike`  |  String  | 
|  Estimated savings (\$1)  |  `NumericEquals \| NumericNotEquals \| NumericLessThan \| NumericLessThanEquals \| NumericGreaterThan \| NumericGreaterThanEquals`  |  Double  | 
|  Lookback period (days)  |  `NumericEquals \| NumericNotEquals \| NumericLessThan \| NumericLessThanEquals \| NumericGreaterThan \| NumericGreaterThanEquals`  |  Integer  | 
|  AWS Region  |  `StringEquals \| StringNotEquals \| StringEqualsIgnoreCase \| StringNotEqualsIgnoreCase \| StringLike \| StringNotLike`  |  String  | 
|  Resource ARN  |  `StringEquals \| StringNotEquals \| StringEqualsIgnoreCase \| StringNotEqualsIgnoreCase \| StringLike \| StringNotLike`  |  String  | 
|  Resource tags  |  `StringEquals \| StringNotEquals \| StringEqualsIgnoreCase \| StringNotEqualsIgnoreCase \| StringLike \| StringNotLike`  |  Resource Tag  | 
|  Restart needed  |  `StringEquals \| StringNotEquals \| StringEqualsIgnoreCase \| StringNotEqualsIgnoreCase \| StringLike \| StringNotLike`  |  String  | 

You can specify up to 20 conditions per attribute and 20 values per condition. For more information, see [Criteria](https://docs.aws.amazon.com/compute-optimizer/latest/APIReference/API_automation_Criteria.html) in the AWS Compute Optimizer Automation API Reference.

## Schedule
<a name="automation-rules-schedule"></a>

Set a schedule for when your rule runs by specifying the frequency (daily, weekly, or monthly), start time, end time, and timezone. During this window, Compute Optimizer will start implementing recommended actions that match your specified criteria. The number of actions that get initiated depends on the duration of your scheduled time window, Compute Optimizer Automation's concurrency limit, and the time required to complete each action. Automated actions will show as "In-Progress" until all steps in the automation workflow are fully completed. Up to 100 actions can be in-progress concurrently per account per AWS Region.

## Rule order
<a name="automation-rules-order"></a>

By default, rules are created with rule order 1 (highest priority) within their rule group. For example, when a management account creates an organization rule configured to apply after member account rules, it receives a rule order of 1, the highest priority among all rules in that group. Rule group and rule order determine which rule applies when a recommended action in an account matches multiple rules. Compute Optimizer assigns the action to the active rule with the lowest rule order value (highest priority), regardless of when that rule is scheduled to run.

For example, if a recommended action matches all of the rules in the following table, Compute Optimizer assigns it to Rule-C and implements it according to Rule-C's schedule.

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/compute-optimizer/latest/ug/automation-rules.html)

# Creating automation rules
<a name="automation-rules-create"></a>

You can use an automation rule to manage automated implementation of recommended actions in Compute Optimizer. For background information about how automation rules work, see [Automation rules](automation-rules.md).

Automation rules are global resources that manage automated actions across all AWS Regions where Compute Optimizer Automation is available.

You can only create one automation rule at a time. To create multiple automation rules, follow the console procedures multiple times, or call the API or command multiple times with your desired parameters.

When you create an automation rule in the Compute Optimizer console, you can preview the current recommended actions that match your rule criteria. This can help you validate and iterate on your rule criteria.

**Important**  
When you create an organization rule in the management account and apply it to member accounts, those member accounts will be able to see the details of the rule from their account. AWS recommends that you don't include personally identifying, confidential, or sensitive information in your rule name, description, or other fields.

**To create an automation rule**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. Choose **Create Automation rule**.

1. If you are creating a rule in the management account or delegated administrator, you can choose the **rule type**, the **member accounts** you want to apply the rule, and whether to apply the rule **before** or **after member account rules**. You can only select member accounts with Automation enabled and organization rules allowed can be selected for the rule to apply.

1. Choose the **action types** you want this rule to implement.

1. (Optional) You can specify **rule criteria** to refine which recommended actions will be automatically implemented. For each criteria, use the `Attribute`, `Operator`, and `Value` drop down menus and input fields to specify your rule criteria
**Important**  
If you don't specify rule criteria, Compute Optimizer applies all recommended action types across the accounts in your rule scope, including recommended actions in all AWS Regions where Compute Optimizer Automation is available. 

1. (Optional) Choose **Refresh matching actions** to get a preview of the recommended actions that match your rule criteria.

1. Set a recurring **Schedule** for your rule to automatically implement matching actions. This includes the frequency (daily, weekly, or monthly), start time, end time, and time zone.

1. (Optional) You can add **Tags** as key-value pairs to your rule to help you easily identify the rule.

1. Provide a rule **name** and a **description** (optional) for your rule.

1. For **Rule status**, choose whether you want the rule to be `Active` or `Inactive` after it's created.

1. Choose **Create Automation rule**.

**Note**  
By default, rules are created with the rule order 1 (highest priority) in their rule group. You can update the rule order from the Automation rules page. To learn more more, see [Editing automation rule order](automation-rules-edit.md).

# Viewing automation rule
<a name="automation-rules-view"></a>

The Automation rules page displays your automation rules and allows you to create and manage them. You can click on each rule to get more details, including the specific rule criteria used to match recommended actions.

**To view automation rules**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. Choose the **rule name** of the rule you want to view details for.

1. You can perform the following actions on the **rule details** page:

   - View rule details and criteria.

   - Enable and disable the rule.

   - Edit the rule.

   - Delete the rule.

   - Manage tags for the rule.

# Updating automation rules
<a name="automation-rules-update"></a>

You can update rules at any time. You can only update the configuration of one rule at a time. Before you enable a rule by changing the rule status from `Inactive` to `Active`, review and confirm your rule criteria. You can preview the matching recommended actions before saving your updated rule criteria. If you change the mode to `Inactive`, any in-progress automation steps initiated by the rule will continue to completion, but no new automation steps will be triggered by the rule.

**To update automation rules**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. Select the rule that you want to update.

1. Choose **Actions** and select **Edit**.

1. Update your rule configuration as needed.

1. Choose **Save changes**.

# Editing automation rule order
<a name="automation-rules-edit"></a>

Rule order determines which rule applies when a recommended action in an account matches multiple rules. Compute Optimizer assigns the action to the active rule with the lowest rule order value (highest priority), regardless of when that rule is scheduled to run. You can edit the rule order at any time. You can only edit one rule at a time. For organization rules, you can also edit the rule group to specify whether the rule applies before or after member account rules.

**To reorder automation rules**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. Find the rule that you want to reorder.

1. Choose the **Rule order** cell for the rule you want to reorder, then use the menu to select the new rule order and choose the check mark icon.

1. When prompted choose Save changes. 

**To edit the rule group (organization rules only)**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. Select the rule that you want to edit.

1. In the **Apply rule** section, choose **Before member account rules** or **After member account rules**.

1. Choose **Save changes**.

1. Review the rule order on the **Automation rules** page to ensure that it matches your intended priority.

# Deleting or disabling automation rules
<a name="automation-rules-delete"></a>

When you delete an automation rule, Compute Optimizer permanently removes it from your account, and it no longer implements recommended actions. Previously implemented actions remain unchanged. To restore the automation rule, you must create a new rule. As an alternative to deletion, you can disable a rule. This retains the rule for future use, but Compute Optimizer won't apply the rule to any matching recommendations until you enable it.

**To delete or disable automation rules**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. Select the rules that you want to delete. You can select up to 10 at a time.

1. Choose Actions and select Delete (to retain a rule and disable it, choose Disable).

1. When prompted, choose Delete (or Disable).

# Creating automation rules with CloudFormation
<a name="creating-automation-rules-with-cloudformation"></a>

AWS Compute Optimizer integrates with AWS CloudFormation, enabling you to define and deploy automation rules with infrastructure-as-code. You can create a template that describes the automation rules you want, and CloudFormation provisions and configures those rules for you. When you use CloudFormation, you can reuse your template to set up your automation rules consistently and repeatedly across multiple AWS accounts.

## Compute Optimizer and CloudFormation templates
<a name="cfn-automation-rules-templates"></a>

To provision and configure automation rules, you must understand how [CloudFormation templates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-guide.html) work. Templates are text files in JSON or YAML format. These templates describe the resources that you want to provision in your CloudFormation stacks.

If you're unfamiliar with JSON or YAML, you can use CloudFormation Designer to help you get started with CloudFormation templates. For more information, see [What is CloudFormation Designer?](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/working-with-templates-cfn-designer.html) in the *AWS CloudFormation User Guide*.

You can create CloudFormation templates for the following types of automation rules:
+ Account rules that apply recommended actions only to your account
+ Organization rules that centrally apply recommended actions across member accounts

For more information, including examples of JSON and YAML templates for automation rules, see [AWS::ComputeOptimizer::AutomationRule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-computeoptimizer-automationrule.html) in the *AWS CloudFormation User Guide*.

## Learn more about CloudFormation
<a name="cfn-automation-rules-learn-more"></a>

To learn more about CloudFormation, see the following resources:
+ [AWS CloudFormation](https://aws.amazon.com/cloudformation/)
+ [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)
+ [AWS CloudFormation API Reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/Welcome.html)
+ [AWS CloudFormation Command Line Interface User Guide](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html)

# Automation events
<a name="automation-events"></a>

The Automation events page is centralized dashboard that displays information about the automated actions initiated through Compute Optimizer. You can review summary information and get details for individual automation events. By default, the dashboard shows information automation events from the last 6 months. You can view events from the past year using the date filter.

The Events summary section summarizes the estimated monthly savings and count for your automation events by status.

You can track events completed over time by viewing the Monthly events summary chart, which summarizes the estimated monthly savings and count for your automation events, grouped by status and the month in which the automation event was created. The chart displays estimated monthly savings (not cumulative savings) for events executed in each month. These savings estimates represent the potential monthly savings calculated at the time of modification and do not reflect actual realized savings in that month or any subsequent months. The Monthly events summary chart shows the sum of all events shown in the Automation events table based on your selected filters. Estimated monthly savings are only displayed for events with Complete and Rollback Complete status.

This Automation events table displays automation events implemented by Compute Optimizer. Review details such as event type, description, status, and estimated monthly savings. These savings estimates represent the potential monthly savings calculated at the time of modification and do not reflect actual realized savings in that month or any subsequent months.

Select an automation event ID to view Event details and step history. The step history table provides a chronological record of operations performed during the automation event. Each step shows the specific action taken to modify your resource, along with its own step status, start time, and completion time.

## Rollback
<a name="automation-events-rollback"></a>

Rollback capabilities that allow you to reverse automated optimization actions if needed. You can initiate rollback from the Automation events page, where you can select and roll back up to 10 automation events at a time. You can only initiate rollback for events with Complete status. 

The specific rollback steps depend on the event type:
+ Snapshot and delete unattached EBS volume: Rolling back volume deletion creates a new EBS volume from the snapshot of the deleted volume. The new volume will have a different volume ID, and all user-created tags on the original volume will be restored to the new volume.
+ Upgrade EBS volume type: Rolling back volume type upgrades will modify the volume to the previous volume type configuration.

There are several considerations for rollback:
+ Compute Optimizer requires the original EBS snapshot created by Compute Optimizer to perform rollback operations for volume deletions. If you delete this snapshot and attempt to roll back the automation event, the rollback operation will fail. 
+ Amazon EBS supports up to four Elastic Volumes modifications per volume within a rolling 24-hour period. Volume modifications applied through Compute Optimizer count toward this limit. After Compute Optimizer completes a volume modification, you can roll back the event as long as the total number of volume modifications in the past 24 hours is fewer than four. Similarly, after a rollback completes, you can initiate additional modifications as long as the total number of modifications remains within the limit. For more information, see the [Amazon EBS User Guide](https://docs.aws.amazon.com/ebs/latest/userguide/ebs-modify-volume.html).
+ Compute Optimizer validates that the current Amazon EBS volume configuration matches the configuration at the time the automation event completed. If you modify the volume configuration after Compute Optimizer completes the automation event and then attempt to roll back the automation event, the rollback operation will fail.

## Automation event statuses
<a name="automation-events-status"></a>

Automation events reports the following status details:


| Event status | Event status reason | 
| --- | --- | 
|  Ready  |  The automation has not started running.  | 
|  In-Progress  |  The automation is running.  | 
|  Complete  |  The automation completed successfully.  | 
|  Failed  |  The automation did not complete successfully.  | 
|  Rollback Ready  |  The rollback has not started running.  | 
|  Rollback In-Progress  |  The rollback is running.  | 
|  Rollback Complete  |  The rollback has completed successfully.  | 
|  Rollback Failed  |  The rollback did not complete successfully.  | 

# View automation events
<a name="automation-events-view-details"></a>

This **Automation events** page displays automation events initiated by Compute Optimizer. Review details such as event type, description, status, and estimated savings.

**To view automation event details**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. You can perform the following actions on the **Automation events **page:

   View total estimated monthly savings and count summary by event status.

   - View monthly summary of automation events by status.

   - (Optional) Filter by date range, account ID (management account only), event status, event type, AWS Region, or Resource type.

   - Review history of automation events, including details on event status, estimated savings, created time, and completed time.

# View automation events details
<a name="automation-events-view"></a>

Select an automation event ID to view more details and step history on **Event details** page.

**To view automation event details**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. Choose the event ID of the automation event you want to get details for.

1. You can perform the following actions on the **Event details** page:

   - View details such as event status, estimated savings, created time, and completed time

   - View step history of operations performed during the automation event. Each step shows the specific action taken to modify your resource, along with its own step status, start time, and completion time. 

   - Initiate a roll back for the automation event.

# Roll back automation events
<a name="automation-events-rb"></a>

You can also initiate rollback for automation events if necessary. You can select and roll back up to 10 automation events at a time. You can only initiate rollback for events with Complete status. 

**To roll back an automation event**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. Select the automation events that you want to roll back. You can select up to 10 events at a time to roll back.

1. Choose **Rollback events**.

1. Review your selected automation events to roll back.

1. Choose **Confirm all rollbacks**.

# Disabling Automation
<a name="automation-disable"></a>

You can disable the Automation feature at any time. However, the management account can't disable Automation for all member accounts in the organization. Each member must disable the feature at the account level.

**Note**  
Disabling Automation stops all of the automation rules in your account. If you opt in again later, all rules will be inactive, and you must enable the rules you want to run. You must wait at least 24 hours after opting out to opt in again.

When the management account disables the Automation feature, Compute Optimizer retains the associations between the management account and its member accounts. If the management account opts back in later, Compute Optimizer automatically restores these associations. However, if a member account opted out independently during the period when the management account had the feature disabled, that member account will not be re-associated when the management account opts back in. 

**To disable the Automation feature**

1. Open the Compute Optimizer console at [https://console.aws.amazon.com/compute-optimizer/](https://console.aws.amazon.com/compute-optimizer/).

1. In the navigation pane, choose **Automation rules** under the **Automation** section.

1. Choose the **Automation** tab.

1. Choose **Disable Automation for account**

1. When prompted for confirmation, choose **Disable Automation**