cloudposse / terraform-aws-ec2-instance

Terraform module for provisioning a general purpose EC2 host
https://cloudposse.com/accelerate
Apache License 2.0
168 stars 221 forks source link

feat(aws_instance): treat missing data on cloudwatchmetric #184

Closed haidargit closed 9 months ago

haidargit commented 10 months ago

what

The PR enables the treat_missing_data argument for the cloudwatch metric alarm resource on this ec2 module. https://github.com/cloudposse/terraform-aws-ec2-instance/blob/bf54345e18c6c2d1d85997d3af3b73a0e03c489f/cloudwatch-alarm.tf#L11

why

Users may have specific run schedules, triggering alerts in CloudWatch, e.g., for missing data during offline periods (instance stopped state, hibernate, restart, etc.). This treat_missing_data variable will enable the CloudWatch alarms to set custom responses, which are "missing", "ignore", "breaching" and "notBreaching", for the data gaps that occur and keep the EC2 alarms condition in a desired state.

references


Kindly review this PR for any possible improvements. Thank you

haidargit commented 9 months ago

Hi @johncblandii, @joe-niland could you help review the PR for the improvement? Thanks!

haidargit commented 9 months ago

Validation added, @joe-niland, Thanks for the correction!

joe-niland commented 9 months ago

/terratest

haidargit commented 9 months ago

variable added on examples/complete/main.tf

Thanks

joe-niland commented 9 months ago

/terratest