UpdateResourceMetricsConfiguration
Updates the resource metrics configuration for an AWS resource. The
MetricSelections value that you provide replaces any existing metric
selections for the resource; it is not merged with them.
If you omit MetricSelections, Amazon CloudWatch removes any existing
metric selection filter and collects all available detailed metrics for the
resource.
This operation returns a ResourceNotFoundException if no resource metrics
configuration exists for the specified resource ARN. To create a configuration, use
CreateResourceMetricsConfiguration.
To update a resource metrics configuration, you must have the
cloudwatch:UpdateResourceMetricsConfiguration permission. For information about scoping
this permission to specific resources, see Condition keys for resource metrics configuration access in the
Amazon CloudWatch User Guide.
Request Parameters
- MetricSelections
-
Specifies which metrics Amazon CloudWatch collects for the resource. The selections that you provide completely replace any existing metric selections.
If you omit this parameter, Amazon CloudWatch removes any existing metric selection filter and collects all available detailed metrics for the resource.
Type: Array of ResourceMetricSelection objects
Array Members: Fixed number of 1 item.
Required: No
- ResourceArn
-
The Amazon Resource Name (ARN) of the AWS resource to update the resource metrics configuration for.
Type: String
Length Constraints: Minimum length of 20. Maximum length of 2048.
Pattern:
arn:[a-zA-Z0-9-]+:[a-zA-Z0-9-]+:[a-zA-Z0-9-]*:\d{12}:.+Required: Yes
Response Elements
The following element is returned by the service.
- ResourceMetricsConfiguration
-
The resource metrics configuration after the update was applied.
Type: ResourceMetricsConfiguration object
Errors
For information about the errors that are common to all actions, see Common Error Types.
- ResourceNotFoundException
-
The named resource does not exist.
HTTP Status Code: 404
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: