-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 #3407 aws_ssm_association handles updates incorrectly #5537
Conversation
… it creates a new version of the association rather than updating it in-place
I am encountering the same issue. Thanks for addressing this. |
…AssociationUpdate
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.
Thanks for fixing this, @dpldb! Left one minor code cleanup note but more importantly, are you able to write an acceptance test that fails against master and succeeds with this pull request? We would like to verify the fix as necessary and prevent regressions in the future. Please reach out if you need help with that or do not have time to implement. Thanks!
|
||
associationInput := &ssm.UpdateAssociationInput{ | ||
AssociationId: aws.String(d.Get("association_id").(string)), | ||
} | ||
|
||
// AWS creates a new version every time the association is updated, so everything should be passed in the update. | ||
|
||
hasChanges := false |
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.
The resourceAwsSsmAssociationUpdate
function is not performing any other API calls beyond UpdateAssociation
so all the hasChanges
logic can be removed 👍
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.
Good point. I'll get rid of this.
@bflad Thanks for the code review and quick response. Happy to help. I'll take a look at the acceptance test. |
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.
LGTM, thanks @dpldb! Since its been two weeks and this is a bug fix, I have added an acceptance test that covers this behavior and refactored out the hasChanges
variable in the update function so we can ship this. 🚀
--- PASS: TestAccAWSSSMAssociation_withDocumentVersion (23.27s)
--- PASS: TestAccAWSSSMAssociation_withAssociationNameAndScheduleExpression (26.62s)
--- PASS: TestAccAWSSSMAssociation_withScheduleExpression (28.05s)
--- PASS: TestAccAWSSSMAssociation_withParameters (29.40s)
--- PASS: TestAccAWSSSMAssociation_withAssociationName (32.30s)
--- PASS: TestAccAWSSSMAssociation_withTargets (47.62s)
--- PASS: TestAccAWSSSMAssociation_withOutputLocation (68.47s)
--- PASS: TestAccAWSSSMAssociation_basic (132.95s)
Thanks @bflad |
This has been released in version 1.34.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Fixes #3407
Changes proposed in this pull request:
Output from acceptance testing: