Skip to content

Commit e5c42c3

Browse files
chasleslrCharles Larivierebryantbiggs
authored
feat: Add path variable to IAM group module (#390)
Co-authored-by: Charles Lariviere <[email protected]> Co-authored-by: Bryant Biggs <[email protected]>
1 parent e3d9cc6 commit e5c42c3

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

examples/iam-group-with-policies/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module "iam_group_with_custom_policies" {
4545
source = "../../modules/iam-group-with-policies"
4646

4747
name = "custom"
48+
path = "/custom/"
4849

4950
group_users = [
5051
module.iam_user1.iam_user_name,

modules/iam-group-with-policies/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ No modules.
4848
| <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 |
4949
| <a name="input_iam_self_management_policy_name_prefix"></a> [iam\_self\_management\_policy\_name\_prefix](#input\_iam\_self\_management\_policy\_name\_prefix) | Name prefix for IAM policy to create with IAM self-management permissions | `string` | `"IAMSelfManagement-"` | no |
5050
| <a name="input_name"></a> [name](#input\_name) | Name of IAM group | `string` | `""` | no |
51+
| <a name="input_path"></a> [path](#input\_path) | Desired path for the IAM group | `string` | `"/"` | no |
5152
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources. | `map(string)` | `{}` | no |
5253

5354
## Outputs

modules/iam-group-with-policies/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resource "aws_iam_group" "this" {
66
count = var.create_group ? 1 : 0
77

88
name = var.name
9+
path = var.path
910
}
1011

1112
resource "aws_iam_group_membership" "this" {

modules/iam-group-with-policies/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ variable "name" {
1010
default = ""
1111
}
1212

13+
variable "path" {
14+
description = "Desired path for the IAM group"
15+
type = string
16+
default = "/"
17+
}
18+
1319
variable "group_users" {
1420
description = "List of IAM users to have in an IAM group which can assume the role"
1521
type = list(string)

wrappers/iam-group-with-policies/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module "wrapper" {
55

66
create_group = try(each.value.create_group, var.defaults.create_group, true)
77
name = try(each.value.name, var.defaults.name, "")
8+
path = try(each.value.path, var.defaults.path, "/")
89
group_users = try(each.value.group_users, var.defaults.group_users, [])
910
custom_group_policy_arns = try(each.value.custom_group_policy_arns, var.defaults.custom_group_policy_arns, [])
1011
custom_group_policies = try(each.value.custom_group_policies, var.defaults.custom_group_policies, [])

0 commit comments

Comments
 (0)