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

Add Trusted Services to iam-assumable-role #31

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions modules/iam-assumable-role/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Trusted resources can be any [IAM ARNs](https://docs.aws.amazon.com/IAM/latest/U
| role\_requires\_mfa | Whether role requires MFA | string | `"true"` | no |
| tags | A map of tags to add to all resources. | map | `{}` | no |
| trusted\_role\_arns | ARNs of AWS entities who can assume these roles | list | `[]` | no |
| trusted\_role\_services | AWS Services that can assume these roles | list | `[]` | no |

## Outputs

Expand Down
5 changes: 5 additions & 0 deletions modules/iam-assumable-role/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ data "aws_iam_policy_document" "assume_role" {
type = "AWS"
identifiers = var.trusted_role_arns
}

principals {
type = "Service"
identifiers = var.trusted_role_services
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions modules/iam-assumable-role/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ variable "trusted_role_arns" {
default = []
}

variable "trusted_role_services" {
description = "AWS Services that can assume these roles"
type = list(string)
default = []
}

variable "mfa_age" {
description = "Max age of valid MFA (in seconds) for roles which require MFA"
type = number
Expand Down