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

[feature] Optionally disable poweruser role iam actions #194

Merged
merged 3 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions aws-iam-role-poweruser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ No requirements.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| authorize\_iam | Indicates if we should augment the PoserUserAccess policy with certain IAM actions. | `bool` | `true` | no |
| iam\_path | n/a | `string` | `"/"` | no |
| oidc | A list of AWS OIDC IDPs to establish a trust relationship for this role. | <pre>list(object(<br> {<br> idp_arn : string, # the AWS IAM IDP arn<br> client_ids : list(string), # a list of oidc client ids<br> provider : string # your provider url, such as foo.okta.com<br> }<br> ))</pre> | `[]` | no |
| role\_name | n/a | `string` | `"poweruser"` | no |
Expand Down
4 changes: 4 additions & 0 deletions aws-iam-role-poweruser/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,17 @@ data "aws_iam_policy_document" "misc" {
}

resource "aws_iam_policy" "misc" {
count = var.authorize_iam ? 1 : 0

name = "${var.role_name}-misc"
path = var.iam_path
description = "Extra permissions we're granting that PowerUserAccess lacks"
policy = data.aws_iam_policy_document.misc.json
}

resource "aws_iam_role_policy_attachment" "misc" {
count = var.authorize_iam ? 1 : 0

role = aws_iam_role.poweruser.name
policy_arn = aws_iam_policy.misc.arn
}
6 changes: 6 additions & 0 deletions aws-iam-role-poweruser/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ variable oidc {
default = []
description = "A list of AWS OIDC IDPs to establish a trust relationship for this role."
}

variable authorize_iam {
type = bool
default = true
description = "Indicates if we should augment the PoserUserAccess policy with certain IAM actions."
}