Skip to content

cloudwatch get-metric-data

Retrieve CloudWatch metric values

Description

retrieve CloudWatch metric values

Synopsis

cloudwatch get-metric-data
    [--site <site>]
    [--region <region>]
    --start_time <start_time>
    --end_time <end_time>
    --query <query>

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

region - (string)

     AWS region for the service
     Example: --region "region-1"
     Default: _None_      Attributes: optional

start_time - (time)

     The time stamp indicating the earliest data to be returned
     Example: --start_time "1h ago"
     Default: 1h ago      Attributes: required

end_time - (time)

     The time stamp indicating the latest data to be returned
     Example: --end_time "now"
     Default: now      Attributes: required

query - (string)

     The metric queries to be returned. A single GetMetricData call can include as many as 500 MetricDataQuery structures
     Example: --query "query-1"
     Default: _None_      Attributes: required

Examples

cloudwatch get-metric-data --region "region-1" --query "query-1"

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "cloudwatch"
Service Instance
Namespace
Object Type "alarm"
Object ID

Please see Access Control for details.