Skip to content

Instantly share code, notes, and snippets.

@officel
Created April 24, 2020 04:17
Show Gist options
  • Save officel/eaede624214f377077323a6d09336076 to your computer and use it in GitHub Desktop.
Save officel/eaede624214f377077323a6d09336076 to your computer and use it in GitHub Desktop.
terraform で AWS IAM Group & User で PATH がセットされているとユーザ自身でパスワード変更できないのか
resource "aws_iam_group" "test" {
name = "test_path"
path = "/test/"
}
resource "aws_iam_group_policy_attachment" "test" {
group = aws_iam_group.test.name
policy_arn = "arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess"
}
resource "aws_iam_group_policy_attachment" "test2" {
group = aws_iam_group.test.name
policy_arn = "arn:aws:iam::aws:policy/IAMSelfManageServiceSpecificCredentials"
}
resource "aws_iam_group_policy_attachment" "test3" {
group = aws_iam_group.test.name
policy_arn = "arn:aws:iam::aws:policy/IAMUserChangePassword"
}
resource "aws_iam_user" "test" {
name = "test_path"
path = "/test/"
}
resource "aws_iam_user_group_membership" "test" {
user = aws_iam_user.test.name
groups = [
aws_iam_group.test.name
]
}
resource "aws_iam_user" "user" {
name = "user"
path = "/path/"
}
resource "aws_iam_user_group_membership" "user" {
user = aws_iam_user.user.name
groups = [
aws_iam_group.test.name
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment