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

move policy from resource to (role) inline policy #24

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions modules/iam_roles/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@ resource "aws_iam_role" "this" {
tfc_oidc_provider_arn = var.tfc_oidc_provider_arn
tfc_hostname = var.tfc_hostname
})
}

resource "aws_iam_policy" "this" {
name = var.aws_iam_role_name_override
description = "Grants terraform cloud access to AWS (generated by terraform). This policy is attached to the role created by terraform. Do not modify this policy manually. If you need to modify the permissions, modify the terraform code and re-run terraform."
policy = jsonencode({
Version = "2012-10-17"
Statement = var.aws_iam_custom_policies
})
}

resource "aws_iam_role_policy_attachment" "this" {
role = aws_iam_role.this.name
policy_arn = aws_iam_policy.this.arn
inline_policy {
name = "tfc"
policy = jsonencode({
Version = "2012-10-17"
Statement = var.aws_iam_custom_policies
})
}
}
Loading