CloudWatch / Client / get_resource_metrics_configuration

get_resource_metrics_configuration

CloudWatch.Client.get_resource_metrics_configuration(**kwargs)

Retrieves the current resource metrics configuration for an Amazon Web Services resource. The response includes the resource ARN, any metric selections, and the times at which the configuration was created and last updated.

This operation returns a ResourceNotFoundException if no resource metrics configuration exists for the specified resource ARN. To create a configuration, use CreateResourceMetricsConfiguration.

To retrieve a resource metrics configuration, you must have the cloudwatch:GetResourceMetricsConfiguration permission. For information about scoping this permission to specific resources, see Condition keys for resource metrics configuration access in the Amazon CloudWatch User Guide.

See also: AWS API Documentation

Request Syntax

response = client.get_resource_metrics_configuration(
    ResourceArn='string'
)
Parameters:

ResourceArn (string) –

[REQUIRED]

The Amazon Resource Name (ARN) of the Amazon Web Services resource to retrieve the resource metrics configuration for.

Return type:

dict

Returns:

Response Syntax

{
    'ResourceMetricsConfiguration': {
        'ResourceArn': 'string',
        'CreatedAt': datetime(2015, 1, 1),
        'UpdatedAt': datetime(2015, 1, 1),
        'MetricSelections': [
            {
                'IncludeMetrics': [
                    'string',
                ]
            },
        ]
    }
}

Response Structure

  • (dict) –

    Returns the current resource metrics configuration for the specified resource.

    • ResourceMetricsConfiguration (dict) –

      The resource metrics configuration for the specified resource.

      • ResourceArn (string) –

        The Amazon Resource Name (ARN) of the Amazon Web Services resource that this configuration applies to.

      • CreatedAt (datetime) –

        The date and time that the resource metrics configuration was created.

      • UpdatedAt (datetime) –

        The date and time that the resource metrics configuration was last updated. When the configuration is first created, this value is the same as CreatedAt.

      • MetricSelections (list) –

        The metrics that Amazon CloudWatch collects for the resource. If this field is not present, Amazon CloudWatch collects all available detailed metrics for the resource.

        • (dict) –

          Specifies which metrics Amazon CloudWatch collects for a resource metrics configuration. Include this in a CreateResourceMetricsConfiguration or UpdateResourceMetricsConfiguration request to limit collection to a specific set of metrics. If you omit metric selections, Amazon CloudWatch collects all available detailed metrics for the resource.

          • IncludeMetrics (list) –

            The names of the metrics to collect for the resource. Amazon CloudWatch collects only the metrics that you list here.

            • (string) –

Exceptions