---
title: Cost Optimization Automations
description: >-
  Set up automations that continuously act on Cloud Cost Recommendations to
  clean up unused or wasteful cloud resources on a recurring schedule.
breadcrumbs: >-
  Docs > Cloud Cost Management > Cloud Cost Recommendations > Cost Optimization
  Automations
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Cost Optimization Automations

## Overview{% #overview %}

Cost Optimization Automations let you continuously act on [Cloud Cost Recommendations](https://docs.datadoghq.com/cloud_cost_management/recommendations.md) without manual cleanup. In the Automations page, they live on the Remediation tab. You define an **automation**, scope it to the accounts, regions, and resources you want, and Datadog executes the recommended action on a recurring schedule. Each run can require human approval in Slack or Microsoft Teams before Datadog makes any changes, so your team stays in control of every change.

Each automation targets a single recommendation type and includes the following:

- A schedule (weekly, biweekly, every 30 days, or every 90 days)
- A scope (account, region, tags, and a maximum number of resources per run)
- Safeguards specific to the recommendation type (for example, a pre-deletion snapshot)
- An optional human approval step routed through Slack or Microsoft Teams

Recommendations acted on by an automation move to Completed automatically and contribute to realized savings on the [Cloud Cost Recommendations](https://docs.datadoghq.com/cloud_cost_management/recommendations.md) page.

Automations are different from the 1-click Workflow Automation actions described in [Recommendation action-taking](https://docs.datadoghq.com/cloud_cost_management/recommendations.md#recommendation-action-taking). 1-click actions execute a single change on demand from the recommendation side panel. Automations execute on a recurring schedule and act on every matching resource in scope.

Automations are also different from [Notifications](https://docs.datadoghq.com/cloud_cost_management/recommendations/notifications.md), which send a recurring Slack summary of matching recommendations but don't take any action.

**Note**: Automations use Datadog Workflows and incur additional costs. For detailed pricing information, see the [Workflow Automation pricing page](https://www.datadoghq.com/pricing/?product=workflow-automation#products).

## Supported recommendation types{% #supported-recommendation-types %}

The Remediation tab supports the following recommendation types:

| Provider | Recommendation type                                             | Built-in safeguards                                                                                |
| -------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| AWS      | Delete unattached EBS volume                                    | (Optional) Takes an EBS snapshot before each volume is deleted.                                    |
| AWS      | Migrate EBS volume from gp2 to gp3                              | Reversible. The migration causes no data loss.                                                     |
| AWS      | Delete unused EBS snapshots                                     | Snapshots referenced by an AMI are skipped.                                                        |
| AWS      | Delete extra on-demand backups (DynamoDB)                       | The two most recent backups are preserved on every run.                                            |
| AWS      | Migrate DynamoDB table to Infrequent Access table class         | Reversible. The table class can be changed back at any time.                                       |
| AWS      | Delete unused DynamoDB table                                    | A backup is taken before each table is deleted.                                                    |
| AWS      | Set CloudWatch logs retention policy                            | Reversible. The retention period can be adjusted or removed at any time.                           |
| AWS      | Delete unused RDS instance                                      | A final RDS snapshot is taken before each instance is deleted.                                     |
| AWS      | Delete unused NAT gateway                                       | None. Deletion is irreversible.                                                                    |
| AWS      | Transition S3 Standard objects to Amazon S3 Intelligent-Tiering | Reversible. Existing lifecycle rules are preserved, and the added rule can be removed at any time. |
| AWS      | Delete unused EC2 instance                                      | (Optional) Creates an AMI before each instance is deleted.                                         |
| AWS      | Delete unused Redshift cluster                                  | A final snapshot is taken before each cluster is deleted.                                          |
| GCP      | Delete unattached Compute Engine disk                           | (Optional) Takes a snapshot before each disk is deleted.                                           |
| GCP      | Enable Autoclass on a Cloud Storage bucket                      | Reversible. Autoclass can be disabled at any time.                                                 |
| Azure    | Delete unattached managed disk                                  | (Optional) Takes a snapshot before each disk is deleted.                                           |
| Azure    | Delete unused SQL database                                      | None. Deletion is irreversible.                                                                    |

Safeguards marked (Optional) are enabled by default and can be turned off in the automation form. All other listed safeguards are always applied and can't be disabled.

## Prerequisites{% #prerequisites %}

- An AWS, GCP, or Azure account configured with [Cloud Cost Recommendations](https://docs.datadoghq.com/cloud_cost_management/recommendations.md#prerequisites) and actively generating recommendations.
- The **Cloud Cost Management - Cloud Cost Management Write** permission to access the Automations page, and the **App Builder & Workflow Automation - Workflows Write** permission to create or edit an automation.
- A connection to each account you want an automation to act on, set up from Manage Connections on the Automations page. Datadog uses this connection to assume a role with the write permissions needed for the recommended action, and grants only the permissions required for the selected recommendation type. To act across multiple accounts with one automation, create a [connection group](https://docs.datadoghq.com/actions/connections.md#connection-groups).
- (Optional) A Slack or Microsoft Teams connection if you want approval messages routed to a channel.

## Set up an automation{% #set-up-an-automation %}

To set up an automation on a recurring schedule for a recommendation type:

1. Navigate to [Cloud Cost > Optimize > Automations](https://app.datadoghq.com/cost/optimize/automations).
1. Select the Remediation tab.
1. On the left side of the page, select the recommendation type.
1. Click Create New Automation.
1. In the Connection dropdown menu, select a connection or connection group configured in [Manage Connections](https://docs.datadoghq.com/actions/connections.md).
1. In the Define scope section:
   1. Enter tags to restrict the automation to resources matching those tags, such as `env`, `service`, and `team`.
   1. Enter the maximum resources per run to cap how many resources the automation acts on during a single execution. The automation prioritizes resources by highest potential savings.
1. In the Set schedule section, select the automation frequency and execution time.
1. (Optional) Enable the Require approval before execution toggle to require human review before execution. If enabled, select Slack or Microsoft Teams, and fill out the channel notification fields. See Safeguards.
1. Enter a name for the automation.
1. Click Save Automation.

### Safeguards{% #safeguards %}

Each recommendation type has built-in safeguards. For example, the **Delete Unattached EBS Volume** automation can take an EBS snapshot before deleting each volume. See Supported recommendation types for the full list of safeguards by recommendation type.

If Require approval before execution is enabled in the automation setup, Datadog posts in the designated channel a summary of the resources targeted on each run. The automation only runs after a user approves the request in the channel.

## Manage automations{% #manage-automations %}

The Remediation tab lists every automation in your organization, grouped by recommendation type. Automations are labeled **policies** in this view. Use the Provider, Resource Type, and Recommendation Type filters at the top of the page to narrow the list. From this page you can:

- Pause or resume an automation
- Edit an automation's scope, schedule, or safeguards
- Rename an automation
- Delete an automation

## Execution history{% #execution-history %}

Open an automation and select the Activity tab to see past and upcoming executions. Each execution record includes:

- Execution time and status (success, failure, or pending approval)
- The resources acted on
- Estimated savings realized by the run
- A link to the underlying Workflow Automation execution

Use the filters at the top of the Activity view to find executions by status, recommendation type, or date range.

## Version history{% #version-history %}

Datadog records a new version of an automation each time it's created, edited, enabled, disabled, or deleted. Open an automation and select the History tab to see who made each change and what changed. Use this view to audit changes or roll back to a previous version.

## Recommendation status{% #recommendation-status %}

When an automation successfully acts on a resource, the corresponding recommendation moves to Completed and is labeled as completed by automation. Its savings count toward the realized savings totals on the [Cloud Cost Recommendations](https://docs.datadoghq.com/cloud_cost_management/recommendations.md) page.

If you set a recommendation to Dismissed, automations skip it on future runs until the dismissal expires.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Cloud Cost Management](https://docs.datadoghq.com/cloud_cost_management.md)
- [Cloud Cost Recommendations](https://docs.datadoghq.com/cloud_cost_management/recommendations.md)
- [Notifications](https://docs.datadoghq.com/cloud_cost_management/recommendations/notifications.md)
- [Workflow Automation](https://docs.datadoghq.com/actions/workflows.md)
