0.11.8
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}"
}
}
aws_cloudwatch_metric_alarm.foo should have been created
terraform plan
This broke since #6151 was merged
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!
Most helpful comment
Sorry for the trouble! Bug fix pull request submitted with acceptance testing to cover these specially formatted ARNs: #6206