-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Updates to tags and ACLs should happen only for non new resources #5072
Conversation
@@ -854,7 +854,7 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { | |||
} | |||
} | |||
if d.HasChange("volume_tags") { | |||
if !d.IsNewResource() || !restricted { | |||
if !d.IsNewResource() || restricted { |
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.
My understanding here is that "restricted" e.g. "gov cloud" accounts don't yet have the option to add tags at creation time so you need to set them afterwards. This change brings the behaviour in line with similar approach on line 848.
Hi @domwong 👋 Thanks for submitting this! Would it be possible to split this PR into multiple? Usually handling one resource or data source per PR (when possible) is easiest for the maintainers to get quickly reviewed and merged, especially when one specific code update might need additional work. I do have a question about the following:
Does this logic potentially exist to handle tag value updates for an existing tag key? Some service APIs do not support updating an existing tag so therefore require delete and create. |
Hi @bflad, Sure, will split this up and comment with new PR numbers here once done.
That's a good point and one that I was not aware of. Will have a dig around and see which services this affects - sounds like I might have to drop that proposed change. |
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! |
Changes proposed in this pull request:
CreateTags
is applied to the attached EBS volume. This is unnecessary since the tags are already created when passed to the initialRunInstances
call. Remove this extra call.diffTags
incorrectly returns tags that exist inoldTags
andnewTags
as needing to be created again. This causes unnecessary calls toCreateTags
. Fix this to return only tags that need to be deleted and created.PutObjectACL
is applied to the S3 bucket. This is unnecessary since the ACLs are already created when passed to the initialCreateBucket
call. Remove this extra call.Output from acceptance testing:
NOTE: I have not run all the tests, only those listed above