Skip to content

Commit

Permalink
feat: Add support for path in `iam-group-with-assumable-roles-polic…
Browse files Browse the repository at this point in the history
…y` (#345)
  • Loading branch information
lesinigo committed Mar 10, 2023
1 parent 20a23cf commit 761368e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/iam-group-with-assumable-roles-policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ No modules.
| <a name="input_assumable_roles"></a> [assumable\_roles](#input\_assumable\_roles) | List of IAM roles ARNs which can be assumed by the group | `list(string)` | `[]` | no |
| <a name="input_group_users"></a> [group\_users](#input\_group\_users) | List of IAM users to have in an IAM group which can assume the role | `list(string)` | `[]` | no |
| <a name="input_name"></a> [name](#input\_name) | Name of IAM policy and IAM group | `string` | n/a | yes |
| <a name="input_path"></a> [path](#input\_path) | Path of IAM policy and IAM group | `string` | `"/"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources. | `map(string)` | `{}` | no |

## Outputs
Expand Down
2 changes: 2 additions & 0 deletions modules/iam-group-with-assumable-roles-policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data "aws_iam_policy_document" "assume_role" {

resource "aws_iam_policy" "this" {
name = var.name
path = var.path
description = "Allows to assume role in another AWS account"
policy = data.aws_iam_policy_document.assume_role.json

Expand All @@ -16,6 +17,7 @@ resource "aws_iam_policy" "this" {

resource "aws_iam_group" "this" {
name = var.name
path = var.path
}

resource "aws_iam_group_policy_attachment" "this" {
Expand Down
6 changes: 6 additions & 0 deletions modules/iam-group-with-assumable-roles-policy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ variable "name" {
type = string
}

variable "path" {
description = "Path of IAM policy and IAM group"
type = string
default = "/"
}

variable "assumable_roles" {
description = "List of IAM roles ARNs which can be assumed by the group"
type = list(string)
Expand Down

0 comments on commit 761368e

Please sign in to comment.