View a markdown version of this page

DeleteMetricDataQueryDefinition - Amazon CloudWatch

DeleteMetricDataQueryDefinition

Deletes a metric data query definition.

This operation is idempotent. If the definition doesn't exist, the operation succeeds without returning an error.

Permissions

To delete a definition, you need the cloudwatch:DeleteMetricDataQueryDefinition permission on the metric data query definition resource. You can use the aws:ResourceTag/${TagKey} condition key to control access based on the tags of the definition.

Request Syntax

{ "Id": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Id

The ID of the metric data query definition to delete.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9-]{1,64}

Required: Yes

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Error Types.

Examples

Example – Delete a metric data query definition

The following AWS CLI command deletes a definition by its ID. Replace the ID with your definition ID. The command doesn't return any output when it succeeds.

Sample Request

PROMPT> aws cloudwatch delete-metric-data-query-definition \ --id a1b2c3d4-5678-90ab-cdef-EXAMPLE11111

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: