-
-
Notifications
You must be signed in to change notification settings - Fork 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
feat: Enables exclusive IAM policy management of IAM role with managed_policy_arns option #526
Conversation
…d_policy_arns option
+1 we could use this |
Hello @bryantbiggs, @antonbabenko, Cloud you review my PR, please. |
I don't understand the problem nor the changes proposed |
I believe what @sksmsWKd is trying to achieve is to prevent manually made changes to the policy attachments for that role (via console or cli) to persist between terraform runs. I.e, someone attaches a policy to the terraformed role via the console - that gets reverted when terraform is applied again.
The way to go around this should probably be implementing the optional use of |
that may or may not be the case, I don't know. we should start with an issue first that describes the challenge so we can understand better before we jump into code changes. closing this for now till we see more around the challenge |
@bryantbiggs |
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. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
This PR supports exclusive management of policy attachments on IAM role.
For prevent resource cycling error,
managed_policy_arns
can't be used with these resources : :aws_iam_role_policy_attachment
oraws_iam_role_policy
.Motivation and Context
When using
aws_iam_role
and this module with themoved
command for refactoring (i mean refactor my resource with this module),although my
aws_iam_role
already containsmanaged_policy_arns
,the
managed_policy_arns
could not be set, so the dependency between IAM role and IAM policy could not be left as code, soaws_iam_role_policy_attachment
had to be added as resource.To prevent unexpected IAM policy changes, i thought adding
managed_policy_arns
option to IAM role can be clear choice for exclusive management of IAM role's policy.Breaking Changes
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request