-
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
r/aws_iam_role_policies_exclusive: new resource #39203
Conversation
Community NoteVoting for Prioritization
For Submitters
|
3d83aa1
to
8efde91
Compare
12adef9
to
d43f0d7
Compare
This resource will enable exclusive management of inline policy assignments to an IAM role. This functions similar to the `inline_policy` blocks when defined on the `aws_iam_role` resource, but as a standalone resource. ```console % make testacc PKG=iam TESTS=TestAccIAMRolePoliciesExclusive_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.23.0 test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAMRolePoliciesExclusive_' -timeout 360m --- PASS: TestAccIAMRolePoliciesExclusive_empty (13.72s) --- PASS: TestAccIAMRolePoliciesExclusive_disappears_Role (13.72s) --- PASS: TestAccIAMRolePoliciesExclusive_basic (15.84s) --- PASS: TestAccIAMRolePoliciesExclusive_multiple (24.25s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/iam 30.454s ```
d43f0d7
to
7bb1c2b
Compare
With the introduction of the `aws_iam_role_policies_exclusive` resource, the provider now has parity with the behavior of the existing `inline_policy` argument. To encourage a single pattern for managing inline policy associations, the inline argument on the role resource is now deprecated. Due to this resources popularity it is undetermined whether the argument will be fully removed in a future major version, but the deprecation warning allows maintainers to direct users to a preferred pattern.
7bb1c2b
to
322dbf3
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.
I'd add more tests and not use "lock." Otherwise, looks good!
% make t T=TestAccIAMRolePoliciesExclusive_ K=iam
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAMRolePoliciesExclusive_' -timeout 360m
=== RUN TestAccIAMRolePoliciesExclusive_basic
=== PAUSE TestAccIAMRolePoliciesExclusive_basic
=== RUN TestAccIAMRolePoliciesExclusive_disappears_Role
=== PAUSE TestAccIAMRolePoliciesExclusive_disappears_Role
=== RUN TestAccIAMRolePoliciesExclusive_multiple
=== PAUSE TestAccIAMRolePoliciesExclusive_multiple
=== RUN TestAccIAMRolePoliciesExclusive_empty
=== PAUSE TestAccIAMRolePoliciesExclusive_empty
=== CONT TestAccIAMRolePoliciesExclusive_basic
=== CONT TestAccIAMRolePoliciesExclusive_multiple
=== CONT TestAccIAMRolePoliciesExclusive_empty
=== CONT TestAccIAMRolePoliciesExclusive_disappears_Role
--- PASS: TestAccIAMRolePoliciesExclusive_disappears_Role (17.93s)
--- PASS: TestAccIAMRolePoliciesExclusive_empty (18.03s)
--- PASS: TestAccIAMRolePoliciesExclusive_basic (19.61s)
--- PASS: TestAccIAMRolePoliciesExclusive_multiple (30.24s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/iam 35.400s
Adds tests to cover out of band additions and removals of inline policies. ```console % make testacc PKG=iam TESTS=TestAccIAMRolePoliciesExclusive_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.22.6 test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAMRolePoliciesExclusive_' -timeout 360m --- PASS: TestAccIAMRolePoliciesExclusive_empty (15.28s) --- PASS: TestAccIAMRolePoliciesExclusive_disappears_Role (15.33s) --- PASS: TestAccIAMRolePoliciesExclusive_basic (17.58s) --- PASS: TestAccIAMRolePoliciesExclusive_outOfBandAddition (24.33s) --- PASS: TestAccIAMRolePoliciesExclusive_outOfBandRemoval (24.34s) --- PASS: TestAccIAMRolePoliciesExclusive_multiple (26.37s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/iam 32.643s ```
This functionality has been released in v5.68.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. |
Description
This resource will enable exclusive management of inline policy assignments to an IAM role. This functions similar to the
inline_policy
blocks when defined on theaws_iam_role
resource, but as a standalone resource.Relations
Relates #22336
Relates #39204
References
Output from Acceptance Testing