-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Enabled updates to existing IAM Access Keys #7961
Conversation
fdd780a
to
48ca2ea
Compare
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 @owenfarrell 👋 Thanks for this contribution! Looking pretty good, two little items and this should be good to go.
@@ -28,6 +29,7 @@ func resourceAwsIamAccessKey() *schema.Resource { | |||
}, | |||
"status": { |
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.
Can you please add a validation function to this attribute? 👍
"status": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{
iam.StatusTypeActive,
iam.StatusTypeInactive,
}, 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.
Done - thanks for the pointer!
@@ -55,6 +55,7 @@ The following arguments are supported: | |||
* `user` - (Required) The IAM user to associate with this access key. | |||
* `pgp_key` - (Optional) Either a base-64 encoded PGP public key, or a | |||
keybase username in the form `keybase:some_person_that_exists`. | |||
* `status` - (Optional) The access key status to apply. Defaults to "Active". |
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.
Can you please note here that the other valid value is Inactive
. Thanks!
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.
Added a line with the set of valid values.
@bflad - I reran the associated acceptance tests after the validation function change and everything still looks good.
|
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 @owenfarrell! 🚀
--- PASS: TestAccAWSAccessKey_basic (7.72s)
--- PASS: TestAccAWSAccessKey_encrypted (7.72s)
--- PASS: TestAccAWSAccessKey_inactive (11.21s)
This has been released in version 2.3.0 of the Terraform 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! |
Community Note
Changes proposed in this pull request:
Output from acceptance testing: