-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
ISSUE-5702: Making the Cloudwatch Event Rule Target target_id optional #5787
Conversation
@@ -29,7 +30,7 @@ func resourceAwsCloudWatchEventTarget() *schema.Resource { | |||
|
|||
"target_id": &schema.Schema{ | |||
Type: schema.TypeString, | |||
Required: true, | |||
Optional: true, | |||
ForceNew: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @iceycake do you still want to force a new resource if the target_id changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be a new resource if the target_id changed (in order to guarantee the uniqueness of the rule target)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Hi @iceycake I just ran the tests and they don't work I'm afraid
|
There was a bug and it seems I get it fixed. Please try again. |
Hi @iceycake just ran the tests again and go the following (twice!)
|
ok, it's far more difficult than i originally thought. The I need to rethink again how to deal with this. |
Nps - Thanks for all of the effort on this! |
…ange with target_id.
I think I got it fixed and didn't see error again using the same cli
Please review it again. |
Hi @iceycake I still can't get this to work I'm afraid
|
I ran into the same problem too. After I cleanup all the aws resources that were created from the previous bad code, I can pass the test. I just ran again:
|
Hi @iceycake You were indeed correct - this was due to cleanup. I will merge this as is and try to make the tests a little more reliable by using different ids :) Thanks for all the hard work on this PR Paul |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
According to the AWS documentation, the target_id is being used to guarantee the uniqueness of the CloudWatch rule target. According to the discussion in #5702, it makes developer life eaiser by having target_id be optional and let terraform to generate the unique ID.