A CloudWatch alarm on a custom metric stays in `INSUFFICIENT_DATA` forever.
BeginnerTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer
Likely causes → The alarm's namespace, metric name or dimensions do not match exactly what is published (an alarm must specify all dimensions). Other causes: the period is shorter than the publish interval, or the metric stopped being sent.
Diagnose →
aws cloudwatch describe-alarms --alarm-names api-errors \
--query 'MetricAlarms[].[Namespace,MetricName,Dimensions,Period,StateReason]'
aws cloudwatch list-metrics --namespace MyApp --metric-name Errors
Fix →
- Copy the exact dimension set from
list-metricsinto the alarm - Make the period match the publishing rate
- For sparse metrics, set
--treat-missing-data notBreaching
Prevent → Create alarms in the same IaC module that defines the metric names, and test alarms with set-alarm-state.
More on CloudFormation, CloudWatch, KMS, Secrets and Cost
Updating a stack fails: `Stack:arn:aws:cloudformation:...:stack/app/... is in ROLLBACK_COMPLETE state and can not be updated.`BeginnerA stack is stuck in `UPDATE_ROLLBACK_FAILED`.AdvancedA pipeline fails with `An error occurred (ValidationError) when calling the UpdateStack operation: No updates are to be performed.`Beginner`InsufficientCapabilitiesException: Requires capabilities : [CAPABILITY_NAMED_IAM]`.BeginnerStack deletion ends in `DELETE_FAILED` with `The bucket you tried to delete is not empty` on an S3 bucket resource.IntermediateDrift detection shows `MODIFIED` on a security group and an RDS instance that someone changed in the console. How do you reconcile?Advanced