-
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
elasticache: Add new user_group_association resource #24204
Conversation
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.
A couple comments, but looks good 🚀
--- PASS: TestAccElastiCacheUserGroupAssociation_basic (283.63s)
--- PASS: TestAccElastiCacheUserGroupAssociation_disappears (287.29s)
--- PASS: TestAccElastiCacheUserGroupAssociation_update (414.01s)
gotUserID := "" | ||
for _, v := range output.UserIds { | ||
if aws.StringValue(v) == userID { | ||
gotUserID = aws.StringValue(v) | ||
break | ||
} | ||
} |
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.
We should handle the unlikely case where the user ID isn't included
Timeout: d.Timeout(schema.TimeoutCreate), | ||
MinTimeout: 10 * time.Second, | ||
NotFoundChecks: 5, | ||
Delay: 30 * time.Second, // Wait 30 secs before starting |
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.
Waiting 30 seconds for the first check and 10 seconds between checks seems like a long delay
id := userGroupAssociationID(d.Get("user_group_id").(string), d.Get("user_id").(string)) | ||
|
||
_, err := tfresource.RetryWhenNotFound(d.Timeout(schema.TimeoutCreate), func() (interface{}, error) { | ||
return conn.ModifyUserGroup(input) |
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.
Is there a risk of a race condition if we're creating or deleting many users at the same time?
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.
Hopefully it will be lessened by the user group existing first. Maybe modifying is more race resilient? I lowered the timeout which should help it not race for as long if it does.
This functionality has been released in v4.10.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Closes #22870
Output from acceptance testing: