CloudWatch stores metrics with different retention periods depending on the granularity. Which of the following correctly describes the retention period for 1-minute metrics?
Think about how CloudWatch stores detailed metrics before aggregating them.
CloudWatch retains 1-minute metrics for 63 days. After that, it aggregates data into 5-minute and 1-hour metrics with longer retention.
You want to monitor an application with detailed metrics but keep CloudWatch costs low. Which metric granularity should you choose to balance detail and cost?
Consider the default granularity and cost implications.
1-minute standard metrics provide detailed monitoring with reasonable cost. 1-second metrics are expensive and usually unnecessary.
You want to restrict access so that a user can only view CloudWatch metrics for a specific EC2 instance. Which IAM policy condition correctly enforces this?
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["cloudwatch:GetMetricData"],
"Resource": "*",
"Condition": {
"StringEquals": {
"cloudwatch:dimension_InstanceId": "i-1234567890abcdef0"
}
}
}]
}CloudWatch metrics can be filtered by dimensions in IAM conditions.
The correct way is to use the condition key "cloudwatch:dimension_InstanceId" to restrict metric access to the specific EC2 instance.
You want to publish a custom metric to CloudWatch with two dimensions: "ServiceName" and "Environment". Which of the following JSON payloads correctly represents this metric data?
Check the correct key names and structure for dimensions in CloudWatch metric data.
The key must be "Dimensions" (plural) and each dimension is an object with "Name" and "Value" keys inside an array.
You have two CloudWatch metrics: CPUUtilization and NetworkIn. You create a metric math expression: CPUUtilization / NetworkIn. If NetworkIn is zero at some points, what will be the output of the expression at those points?
Think about how CloudWatch handles division by zero in metric math.
CloudWatch metric math returns null (no data) for points where division by zero would occur, avoiding errors or infinite values.