Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_cloudwatch_metric_alarm does not validate input on alarm_actions #6092

Closed
ghost opened this issue Oct 8, 2018 · 4 comments · Fixed by #6151
Closed

aws_cloudwatch_metric_alarm does not validate input on alarm_actions #6092

ghost opened this issue Oct 8, 2018 · 4 comments · Fixed by #6151
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.
Milestone

Comments

@ghost
Copy link

ghost commented Oct 8, 2018

This issue was originally opened by @sprutner as hashicorp/terraform#19015. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

0.11.8

Terraform Configuration Files

resource "aws_cloudwatch_metric_alarm" "down-blue" {
  alarm_name          = "${var.blue_asg_name}-High-CPU-Utilization-LT-10"
  comparison_operator = "LessThanThreshold"
  evaluation_periods  = "${var.scale_down_evaluation_periods}"
  metric_name         = "${var.scaling_metric}"
  namespace           = "AWS/EC2"
  period              = "${var.scale_down_evaluation_period}"
  statistic           = "Average"
  threshold           = "${var.scale_down_threshold}"

  dimensions {
    AutoScalingGroupName = "${var.blue_asg_name}"
  }

  alarm_description = "This metric monitors ec2 cpu utilization"
  **alarm_actions     = ["${aws_autoscaling_policy.down-blue.name}"]**
}

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. Simply put an autoscaling group name in alarm_actions instead of an ARN.

Additional Context

This should be an easy fix if you just use a regex or something to check if it's an ARN being passed in.

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/cloudwatch Issues and PRs that pertain to the cloudwatch service. labels Oct 8, 2018
@tkbky
Copy link
Contributor

tkbky commented Oct 14, 2018

I've made a PR for this.

@bflad bflad added this to the v1.41.0 milestone Oct 14, 2018
@bflad
Copy link
Contributor

bflad commented Oct 14, 2018

The ARN validation has been merged and will release in version 1.41.0 of the AWS provider, likely middle of this week. 👍

@bflad
Copy link
Contributor

bflad commented Oct 18, 2018

This has been released in version 1.41.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link
Author

ghost commented Apr 2, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/cloudwatch Issues and PRs that pertain to the cloudwatch service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants