[Bug]: aws_cloudwatch_metric_alarm: Inconsistent plan when depending on data resource #34661
Labels
bug
Addresses a defect in current functionality.
service/cloudwatch
Issues and PRs that pertain to the cloudwatch service.
Terraform Core Version
1.6.4
AWS Provider Version
5.28.0
Affected Resource(s)
aws_cloudwatch_metric_alarm
Expected Behavior
When following the README.md of the minimal example repository, the apply should happen without any error.
Actual Behavior
The apply fails with the following error:
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
A minimal example to reproduce the inconsistent plan is available here.
Steps to Reproduce
Follow the instructions of the README.md of the above repository to reproduce the issue.
Debug Output
No response
Panic Output
No response
Important Factoids
The minimal example creates an Beanstalk Environment. With a
data.aws_lb
resource, the (application) load balancer belonging to the Beanstalk is extracted and used in a CloudWatch alarm.When a setting in the Beanstalk that has nothing to do with the load balancer is changed later, an inconsistent plan for the CloudWatch alarm is shown.
Due to the nature of the Beanstalk being created with a CloudFormation stack, the ARN of the load balancer is only known to the
data
resource at the apply phase. But it is unclear why an inconsistent plan is created when the ARN of the load balancer does not change in the end.References
Minimal example to reproduce: https://github.com/dennis-grunert/minimal-example-beanstalk
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: