Skip to content
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

Exclusive management of inline & managed policies for IAM users #17512

Closed
YakDriver opened this issue Feb 8, 2021 · 5 comments
Closed

Exclusive management of inline & managed policies for IAM users #17512

YakDriver opened this issue Feb 8, 2021 · 5 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. partition/aws-us-gov Pertains to the aws-us-gov partition. service/iam Issues and PRs that pertain to the iam service.

Comments

@YakDriver
Copy link
Member

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Descends from #4426

Description

Add feature to revert out-of-band changes to attached (managed) and inline policies associated with an IAM user.

New or Affected Resource(s)

  • aws_iam_user

Potential Terraform Configuration

resource "aws_iam_user" "example" {
  name          = "yak_user"
  inline_policy = []
}

resource "aws_iam_user" "example" {
  name = "yak_user"

  inline_policy {
    name = "my_inline_policy"

    policy = <<EOF
{
  "Statement": [
    {
      "Action": [
        "ec2:Describe*"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ],
  "Version": "2012-10-17"
}
EOF
  }

  inline_policy {
    name   = "policy-8675309"
    policy = data.aws_iam_policy_document.inline_policy.json
  }
}

resource "aws_iam_user" "example" {
  name                = "yak_user"
  managed_policy_arns = [aws_iam_policy.policy_one.arn, aws_iam_policy.policy_two.arn]
}

References

@ChaseFreeman17
Copy link

ChaseFreeman17 commented Aug 23, 2022

I would love to see this prioritized higher, until this is implemented drift will not show when managed policies or inline policies are attached to a IAM User outside of Terraform.

Basically if we see "aws_iam_user_policy_attachment" resource block we consider that as risk to our IaC as it will not drift properly.

I think the implementation of #17510 is exactly what is needed for users.

Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Sep 15, 2024
@lorengordon
Copy link
Contributor

Not stale, still highly desired

@github-actions github-actions bot removed the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Sep 15, 2024
@jar-b
Copy link
Member

jar-b commented Oct 22, 2024

Closed via #39731 and #39544.

Exclusive relationship management resources for inline and managed policies are available in versions >= 5.72.1 of the AWS provider.

@jar-b jar-b closed this as completed Oct 22, 2024
Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. partition/aws-us-gov Pertains to the aws-us-gov partition. service/iam Issues and PRs that pertain to the iam service.
Projects
None yet
Development

No branches or pull requests

4 participants