-
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
resource/aws_iam_role: Add exclusive list support for a role's inline and managed policies #5904
resource/aws_iam_role: Add exclusive list support for a role's inline and managed policies #5904
Conversation
6e5d3c2
to
069e2f4
Compare
069e2f4
to
b22f79e
Compare
b22f79e
to
d073ca7
Compare
d073ca7
to
7c89c82
Compare
7c89c82
to
89163a3
Compare
@bflad This PR is complete and ready for review and adjust. |
89163a3
to
a9ceccc
Compare
1208149
to
387b80b
Compare
After latest changes. GovCloud:
|
Awesome! I will hopefully get 👀 on this later today between other meetings. |
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 few minor documentation nits, otherwise, I think this is good to go. 🚀
Output from acceptance testing in AWS Commercial:
--- PASS: TestAccAWSIAMRole_badJSON (9.67s)
--- PASS: TestAccAWSIAMRole_basic (54.29s)
--- PASS: TestAccAWSIAMRole_basicWithDescription (87.86s)
--- PASS: TestAccAWSIAMRole_disappears (43.86s)
--- PASS: TestAccAWSIAMRole_force_detach_policies (57.56s)
--- PASS: TestAccAWSIAMRole_MaxSessionDuration (90.66s)
--- PASS: TestAccAWSIAMRole_namePrefix (56.02s)
--- PASS: TestAccAWSIAMRole_PermissionsBoundary (111.15s)
--- PASS: TestAccAWSIAMRole_policyBasicInline (99.49s)
--- PASS: TestAccAWSIAMRole_policyBasicInlineEmpty (45.87s)
--- PASS: TestAccAWSIAMRole_policyBasicManaged (100.01s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_inlineNonExistent (94.01s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_managedNonExistent (77.75s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineEmpty (76.56s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineNonEmpty (82.36s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedEmpty (79.22s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedNonEmpty (84.76s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_inlineNonEmpty (77.85s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_managedNonEmpty (84.45s)
--- PASS: TestAccAWSIAMRole_tags (80.21s)
--- PASS: TestAccAWSIAMRole_testNameChange (90.14s)
Output from acceptance testing in AWS GovCloud (US):
--- PASS: TestAccAWSIAMRole_badJSON (5.57s)
--- PASS: TestAccAWSIAMRole_basic (57.30s)
--- PASS: TestAccAWSIAMRole_basicWithDescription (102.41s)
--- PASS: TestAccAWSIAMRole_disappears (50.09s)
--- PASS: TestAccAWSIAMRole_force_detach_policies (67.29s)
--- PASS: TestAccAWSIAMRole_MaxSessionDuration (93.17s)
--- PASS: TestAccAWSIAMRole_namePrefix (60.44s)
--- PASS: TestAccAWSIAMRole_PermissionsBoundary (130.63s)
--- PASS: TestAccAWSIAMRole_policyBasicInline (108.80s)
--- PASS: TestAccAWSIAMRole_policyBasicInlineEmpty (52.58s)
--- PASS: TestAccAWSIAMRole_policyBasicManaged (108.62s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_inlineNonExistent (99.44s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_managedNonExistent (83.08s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineEmpty (32.71s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineNonEmpty (87.56s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedEmpty (82.95s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedNonEmpty (89.16s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_inlineNonEmpty (87.59s)
--- PASS: TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_managedNonEmpty (89.06s)
--- PASS: TestAccAWSIAMRole_tags (86.97s)
--- PASS: TestAccAWSIAMRole_testNameChange (91.27s)
inline_policy { | ||
name = "my_inline_policy" | ||
|
||
policy = <<EOF |
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.
Nit: Let's use jsonencode()
or aws_iam_policy_document
data source here. 👍 Reference: #17714
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
resource "aws_iam_policy" "policy_one" { | ||
name = "policy-618033" | ||
|
||
policy = <<EOF |
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.
Nit: Similarly here and below with jsonencode()
/aws_iam_policy_document
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
Co-authored-by: Brian Flad <[email protected]>
Co-authored-by: Brian Flad <[email protected]>
Co-authored-by: Brian Flad <[email protected]>
Am getting
|
@gowthamakanthan this was released in v3.29.1 of the aws provider. your output shows v3.1.0. you'll need to upgrade your provider version to use this feature... |
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
Relates #4426, #17511, #17512
Closes #17510
Release note for CHANGELOG:
Inline policy example:
Managed policy example:
Output from acceptance testing (Sep. 17, original acceptance tests - when PR was for a new resource called
aws_iam_role_policy_list
):Output from acceptance testing of
resource/aws_iam_policy
: