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

resource/aws_cloudwatch_event_rule: Prevent multiple names on creation #4579

Merged
merged 1 commit into from
May 23, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented May 18, 2018

Fixes #4547

Changes proposed in this pull request:

  • Only perform name_prefix/generated name logic once on creation

Create -> Update -> Read strikes again! Similar as observed in the issue, the daily acceptance testing has been leaving dangling rules:

$ aws events list-rules | jq '.Rules[] | .Name'
"tf-acc-cw-event-rule-prefix-20180426162323934100000002"
"tf-acc-cw-event-rule-prefix-20180426162514120400000002"
"tf-acc-cw-event-rule-prefix-20180427053026579200000002"
"tf-acc-cw-event-rule-prefix-20180428060328552200000002"
"tf-acc-cw-event-rule-prefix-20180429060519520300000002"
"tf-acc-cw-event-rule-prefix-20180501053203121800000002"
"tf-acc-cw-event-rule-prefix-20180502053210453100000002"
"tf-acc-cw-event-rule-prefix-20180503060601159900000002"
"tf-acc-cw-event-rule-prefix-20180504063840134000000002"
"tf-acc-cw-event-rule-prefix-20180505054500305900000002"
"tf-acc-cw-event-rule-prefix-20180506060233773100000002"
"tf-acc-cw-event-rule-prefix-20180508053138002100000002"
"tf-acc-cw-event-rule-prefix-20180509053336875600000002"
"tf-acc-cw-event-rule-prefix-20180510064223367500000002"
"tf-acc-cw-event-rule-prefix-20180512060518989300000002"
"tf-acc-cw-event-rule-prefix-20180514053257185000000002"
"tf-acc-cw-event-rule-prefix-20180515054306224300000002"
"tf-acc-cw-event-rule-prefix-20180516062014304000000002"
"tf-acc-cw-event-rule-prefix-20180517053608965300000002"

After code update and re-running this test:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudWatchEventRule_prefix'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSCloudWatchEventRule_prefix -timeout 120m
=== RUN   TestAccAWSCloudWatchEventRule_prefix
--- PASS: TestAccAWSCloudWatchEventRule_prefix (18.37s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	18.403s

The dangling name is not created.

@bflad bflad added bug Addresses a defect in current functionality. service/cloudwatchevents labels May 18, 2018
@bflad bflad added this to the v1.20.0 milestone May 18, 2018
@bflad bflad requested a review from a team May 18, 2018 04:24
@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label May 18, 2018
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bflad bflad merged commit 38abf74 into master May 23, 2018
@bflad bflad deleted the b-aws_cloudwatch_event_rule-prevent-double-events branch May 23, 2018 13:33
bflad added a commit that referenced this pull request May 23, 2018
@bflad
Copy link
Contributor Author

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. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specifying name_prefix in aws_cloudwatch_event_rule causes resource to be created twice
2 participants