Terraform-provider-aws: aws_cloudwatch_metric_alarm AlarmActions ARN incorrectly rejected in 1.41.0

Created on 18 Oct 2018  ·  9Comments  ·  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

0.11.8

Affected Resource(s)

  • aws_cloudwatch_metric_alarm

Terraform Configuration Files

data "aws_region" "current_region" {}

resource "aws_cloudwatch_metric_alarm" "foo" {
  count               = 1
  alarm_name          = "foo"
  alarm_description   = "Status checks have failed for system, recovering instance"
  namespace           = "AWS/EC2"
  statistic           = "Minimum"
  comparison_operator = "GreaterThanThreshold"
  threshold           = "0"
  unit                = "Count"
  evaluation_periods  = "2"
  period              = "60"
  metric_name         = "StatusCheckFailed_System"
  alarm_actions       = ["arn:aws:automate:${data.aws_region.current_region.name}:ec2:recover"]

  dimensions {
    InstanceId = "${var.instanceid}"
  }
}

Expected Behavior

aws_cloudwatch_metric_alarm.foo should have been created

Actual Behavior

  • resource.aws_cloudwatch_metric_alarm.foo: "alarm_actions.0" doesn't look like a valid ARN ("^arn:[\w-]+:([a-zA-Z0-9\-])+:([a-z]{2}-(gov-)?[a-z]+-\d{1})?:(\d{12})?:(.*)$"): "arn:aws:automate:eu-west-1:ec2:recover"

Steps to Reproduce

  1. terraform plan

Important Factoids

This broke since #6151 was merged

References

bug regression serviccloudwatch

Most helpful comment

Sorry for the trouble! Bug fix pull request submitted with acceptance testing to cover these specially formatted ARNs: #6206

All 9 comments

Sorry for the trouble! Bug fix pull request submitted with acceptance testing to cover these specially formatted ARNs: #6206

@bflad No problem! Appreciate the quick fix :-)

Hello,

Thanks for the quick fix ! Is a hotfix release planned in order to quickly fix this bug upstream ?

This will likely be released on the normal weekly cadence. As a workaround, you can pin your configuration to the previous provider release, e.g.

provider "aws" {
  # ... potentially other configuration ...
  version = "1.40.0"
}

Thank you.

Thanks for your patience -- the fix for this has been merged and will release with version 1.42.0 of the AWS provider, likely today or tomorrow.

I am also having fun troubleshooting this bug today, trying to run a terraform plan against an existing infrastructure with a CloudWatch StatusCheckFailed alarm that was previously created and working fine in a terraform apply:

Error: aws_cloudwatch_metric_alarm.status-check: "alarm_actions.0" doesn't look like a valid ARN ("^arn:[\\w-]+:([a-zA-Z0-9\\-])+:([a-z]{2}-(gov-)?[a-z]+-\\d{1})?:(\\d{12})?:(.*)$"): "arn:aws:automate:us-east-1:ec2:recover"

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

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!

Was this page helpful?
0 / 5 - 0 ratings