-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Use ParameterFilters instead of regular Filters on SSM parameter #5325
Use ParameterFilters instead of regular Filters on SSM parameter #5325
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.
Thanks so much for all the investigative work and figuring out a really workable solution @julienduchesne 🥇 🥇 🥇 This looks like the best option here given the API behavior. We should add checks to prevent panics before referencing where we expect the new result, but I can add that in a quick commit after yours so we can get this released today. 🚀
10 tests passed (all tests)
=== RUN TestAccAWSSSMParameter_disappears
--- PASS: TestAccAWSSSMParameter_disappears (5.44s)
=== RUN TestAccAWSSSMParameter_fullPath
--- PASS: TestAccAWSSSMParameter_fullPath (8.59s)
=== RUN TestAccAWSSSMParameter_secure
--- PASS: TestAccAWSSSMParameter_secure (8.66s)
=== RUN TestAccAWSSSMParameter_basic
--- PASS: TestAccAWSSSMParameter_basic (12.62s)
=== RUN TestAccAWSSSMParameter_importBasic
--- PASS: TestAccAWSSSMParameter_importBasic (13.66s)
=== RUN TestAccAWSSSMParameter_changeNameForcesNew
--- PASS: TestAccAWSSSMParameter_changeNameForcesNew (15.61s)
=== RUN TestAccAWSSSMParameter_updateDescription
--- PASS: TestAccAWSSSMParameter_updateDescription (18.78s)
=== RUN TestAccAWSSSMParameter_update
--- PASS: TestAccAWSSSMParameter_update (24.46s)
=== RUN TestAccAWSSSMParameter_secure_with_key
--- PASS: TestAccAWSSSMParameter_secure_with_key (35.99s)
=== RUN TestAccAWSSSMParameter_secure_keyUpdate
--- PASS: TestAccAWSSSMParameter_secure_keyUpdate (39.94s)
aws/resource_aws_ssm_parameter.go
Outdated
|
||
detail := detailedParameters[0] | ||
detail := describeResp.Parameters[0] |
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.
To prevent potential panics, we should perform a nil
check on describeResp
and len()
check on describeResp.Parameters
before attempting to reference, e.g.
if describeResp == nil || len(describeResp.Parameters) == 0 || describeResp.Parameters[0] == nil {
log.Printf("[WARN] SSM Parameter %q not found, removing from state", d.Id())
d.SetId("")
return nil
}
detail := describeResp.Parameters[0]
Good point about the nil checks. Fixed it. Thanks for the quick 🚀 response!
|
This has been released in version 1.29.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 #5281
Changes proposed in this pull request:
ParameterFilters
with theEquals
option.Output from acceptance testing: