Skip to content

Updates the resource metrics configuration for an Amazon Web Services resource

Description

Updates the resource metrics configuration for an Amazon Web Services 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 create_resource_metrics_configuration.

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.

Usage

cloudwatch_update_resource_metrics_configuration(ResourceArn,
  MetricSelections)

Arguments

  • ResourceArn

    [required] The Amazon Resource Name (ARN) of the Amazon Web Services resource to update the resource metrics configuration for.

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

Value

A list with the following syntax:

list(
  ResourceMetricsConfiguration = list(
    ResourceArn = "string",
    CreatedAt = as.POSIXct(
      "2015-01-01"
    ),
    UpdatedAt = as.POSIXct(
      "2015-01-01"
    ),
    MetricSelections = list(
      list(
        IncludeMetrics = list(
          "string"
        )
      )
    )
  )
)

Request syntax

svc$update_resource_metrics_configuration(
  ResourceArn = "string",
  MetricSelections = list(
    list(
      IncludeMetrics = list(
        "string"
      )
    )
  )
)