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

Specifying name_prefix in aws_cloudwatch_event_rule causes resource to be created twice #4547

Closed
otterley opened this issue May 16, 2018 · 4 comments · Fixed by #4579
Closed
Labels
bug Addresses a defect in current functionality.
Milestone

Comments

@otterley
Copy link

Summary

Specifying name_prefix instead of name as a parameter to an aws_cloudwatch_event_rule causes the provider to create the resource twice. One of them, however, will be orphaned by Terraform and will not be tracked in the state, leaving the Rule configured with CloudWatch even after a destroy operation until manually deleted by the user.

Terraform Version

Terraform v0.11.7

  • provider.aws v1.18.0

Affected Resource(s)

  • aws_cloudwatch_event_rule

Terraform Configuration Files

resource "aws_cloudwatch_event_rule" "ebs_backup" {
  name_prefix         = "ebs-backup-"
  # note: using "name" instead cures the problem
  description         = "Back up ${var.volume_name} every ${var.frequency}"
  schedule_expression = "rate(${var.frequency})"
  is_enabled          = "${var.enable_event_rule}"
}

Expected Behavior

A single CloudWatch Event Rule should be created with the specified name prefix.

Actual Behavior

Two CloudWatch Event Rules are created with the specified name prefix.

Steps to Reproduce

Declare a resource similar to the one above and apply it.

@bflad
Copy link
Contributor

bflad commented May 18, 2018

Thanks for reporting this. Bug fix pull request submitted: #4579

@bflad bflad added this to the v1.20.0 milestone May 18, 2018
@bflad
Copy link
Contributor

bflad commented May 23, 2018

The fix for this will release with v1.20.0 of the AWS provider, likely later today. 👍

@bflad
Copy link
Contributor

bflad commented May 23, 2018

This has been released in version 1.20.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

ghost commented Apr 5, 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 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
2 participants