For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/cloud_cost_management/recommendations/cost_optimization_automation.md. A documentation index is available at /llms.txt.

Overview

Cost Optimization Automations let you continuously act on Cloud Cost Recommendations 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 page.

Automations are different from the 1-click Workflow Automation actions described in 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, which send a recurring Slack or Microsoft Teams 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.

Supported recommendation types

The Remediation tab supports the following recommendation types:

ProviderRecommendation typeBuilt-in safeguards
AWSDelete unattached EBS volume(Optional) Takes an EBS snapshot before each volume is deleted.
AWSMigrate EBS volume from gp2 to gp3Reversible. The migration causes no data loss.
AWSDelete unused EBS snapshotsSnapshots referenced by an AMI are skipped.
AWSDelete extra on-demand backups (DynamoDB)The two most recent backups are preserved on every run.
AWSMigrate DynamoDB table to Infrequent Access table classReversible. The table class can be changed back at any time.
AWSDelete unused DynamoDB tableA backup is taken before each table is deleted.
AWSSet CloudWatch logs retention policyReversible. The retention period can be adjusted or removed at any time.
AWSDelete unused RDS instanceA final RDS snapshot is taken before each instance is deleted.
AWSDelete unused NAT gatewayNone. Deletion is irreversible.
AWSTransition S3 Standard objects to Amazon S3 Intelligent-TieringReversible. Existing lifecycle rules are preserved, and the added rule can be removed at any time.
AWSDelete unused EC2 instance(Optional) Creates an AMI before each instance is deleted.
AWSDelete unused Redshift clusterA final snapshot is taken before each cluster is deleted.
GCPDelete unattached Compute Engine disk(Optional) Takes a snapshot before each disk is deleted.
GCPEnable Autoclass on a Cloud Storage bucketReversible. Autoclass can be disabled at any time.
AzureDelete unattached managed disk(Optional) Takes a snapshot before each disk is deleted.
AzureDelete unused SQL databaseNone. 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

  • An AWS, GCP, or Azure account configured with Cloud Cost Recommendations 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.
  • (Optional) A Slack or Microsoft Teams connection if you want approval messages routed to a channel.

Set up an automation

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

  1. Navigate to Cloud Cost > Optimize > Automations.
  2. Select the Remediation tab.
  3. On the left side of the page, select the recommendation type.
  4. Click Create New Automation.
  5. In the Connection dropdown menu, select a connection or connection group configured in Manage Connections.
  6. In the Define scope section:
    1. Enter tags to restrict the automation to resources matching those tags, such as env, service, and team.
    2. 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.
  7. In the Set schedule section, select the automation frequency and execution time.
  8. (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.
  9. Enter a name for the automation.
  10. Click Save Automation.

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

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

Run history

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

  • Run timestamp and status (success, failure, or pending approval)
  • The resources acted on
  • Estimated savings realized by the run
  • A link to the underlying Workflow Automation run

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

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

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 page.

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

Further reading