Skip to content

Commit fc23676

Browse files
committed
fix: Corrections
1 parent dc00ba8 commit fc23676

File tree

9 files changed

+17
-18
lines changed

9 files changed

+17
-18
lines changed

modules/iam-assumable-role-with-saml/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ No modules.
3737

3838
| Name | Description | Type | Default | Required |
3939
|------|-------------|------|---------|:--------:|
40+
| <a name="input_actions"></a> [actions](#input\_actions) | Additional role actions | `list(string)` | <pre>[<br> "sts:AssumeRoleWithSAML",<br> "sts:TagSession"<br>]</pre> | no |
4041
| <a name="input_allow_self_assume_role"></a> [allow\_self\_assume\_role](#input\_allow\_self\_assume\_role) | Determines whether to allow the role to be [assume itself](https://aws.amazon.com/blogs/security/announcing-an-update-to-iam-role-trust-policy-behavior/) | `bool` | `false` | no |
4142
| <a name="input_aws_saml_endpoint"></a> [aws\_saml\_endpoint](#input\_aws\_saml\_endpoint) | AWS SAML Endpoint | `string` | `"https://signin.aws.amazon.com/saml"` | no |
4243
| <a name="input_create_role"></a> [create\_role](#input\_create\_role) | Whether to create a role | `bool` | `false` | no |
@@ -52,7 +53,6 @@ No modules.
5253
| <a name="input_role_permissions_boundary_arn"></a> [role\_permissions\_boundary\_arn](#input\_role\_permissions\_boundary\_arn) | Permissions boundary ARN to use for IAM role | `string` | `""` | no |
5354
| <a name="input_role_policy_arns"></a> [role\_policy\_arns](#input\_role\_policy\_arns) | List of ARNs of IAM policies to attach to IAM role | `list(string)` | `[]` | no |
5455
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to IAM role resources | `map(string)` | `{}` | no |
55-
| <a name="input_trusted_role_actions"></a> [trusted\_role\_actions](#input\_trusted\_role\_actions) | Actions of STS | `list(string)` | <pre>[<br> "sts:AssumeRoleWithSAML",<br> "sts:TagSession"<br>]</pre> | no |
5656

5757
## Outputs
5858

modules/iam-assumable-role-with-saml/main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ data "aws_iam_policy_document" "assume_role_with_saml" {
3434

3535
statement {
3636
effect = "Allow"
37-
actions = compact(distinct(concat(["sts:AssumeRoleWithSAML"], var.trusted_role_actions)))
37+
actions = compact(distinct(concat(["sts:AssumeRoleWithSAML"], var.actions)))
3838

3939
principals {
40-
type = "Federated"
41-
40+
type = "Federated"
4241
identifiers = local.identifiers
4342
}
4443

modules/iam-assumable-role-with-saml/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ variable "allow_self_assume_role" {
8888
default = false
8989
}
9090

91-
variable "trusted_role_actions" {
92-
description = "Actions of STS"
91+
variable "actions" {
92+
description = "Additional role actions"
9393
type = list(string)
9494
default = ["sts:AssumeRoleWithSAML", "sts:TagSession"]
9595
}

modules/iam-assumable-role/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ No modules.
6666
| <a name="input_role_session_name"></a> [role\_session\_name](#input\_role\_session\_name) | role\_session\_name for roles which require this parameter when being assumed. By default, you need to set your own username as role\_session\_name | `list(string)` | <pre>[<br> "${aws:username}"<br>]</pre> | no |
6767
| <a name="input_role_sts_externalid"></a> [role\_sts\_externalid](#input\_role\_sts\_externalid) | STS ExternalId condition values to use with a role (when MFA is not required) | `any` | `[]` | no |
6868
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to IAM role resources | `map(string)` | `{}` | no |
69-
| <a name="input_trusted_role_actions"></a> [trusted\_role\_actions](#input\_trusted\_role\_actions) | Actions of STS | `list(string)` | <pre>[<br> "sts:AssumeRole",<br> "sts:TagSession"<br>]</pre> | no |
69+
| <a name="input_trusted_role_actions"></a> [trusted\_role\_actions](#input\_trusted\_role\_actions) | Additional trusted role actions | `list(string)` | <pre>[<br> "sts:AssumeRole",<br> "sts:TagSession"<br>]</pre> | no |
7070
| <a name="input_trusted_role_arns"></a> [trusted\_role\_arns](#input\_trusted\_role\_arns) | ARNs of AWS entities who can assume these roles | `list(string)` | `[]` | no |
7171
| <a name="input_trusted_role_services"></a> [trusted\_role\_services](#input\_trusted\_role\_services) | AWS Services that can assume these roles | `list(string)` | `[]` | no |
7272

modules/iam-assumable-role/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variable "trusted_role_actions" {
2-
description = "Actions of STS"
2+
description = "Additional trusted role actions"
33
type = list(string)
44
default = ["sts:AssumeRole", "sts:TagSession"]
55
}

modules/iam-assumable-roles/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ No modules.
6666
| <a name="input_readonly_role_policy_arns"></a> [readonly\_role\_policy\_arns](#input\_readonly\_role\_policy\_arns) | List of policy ARNs to use for readonly role | `list(string)` | <pre>[<br> "arn:aws:iam::aws:policy/ReadOnlyAccess"<br>]</pre> | no |
6767
| <a name="input_readonly_role_requires_mfa"></a> [readonly\_role\_requires\_mfa](#input\_readonly\_role\_requires\_mfa) | Whether readonly role requires MFA | `bool` | `true` | no |
6868
| <a name="input_readonly_role_tags"></a> [readonly\_role\_tags](#input\_readonly\_role\_tags) | A map of tags to add to readonly role resource. | `map(string)` | `{}` | no |
69-
| <a name="input_trusted_role_actions"></a> [trusted\_role\_actions](#input\_trusted\_role\_actions) | Actions of STS | `list(string)` | <pre>[<br> "sts:AssumeRole"<br>]</pre> | no |
69+
| <a name="input_trusted_role_actions"></a> [trusted\_role\_actions](#input\_trusted\_role\_actions) | Additional trusted role actions | `list(string)` | <pre>[<br> "sts:AssumeRole",<br> "sts:TagSession"<br>]</pre> | no |
7070
| <a name="input_trusted_role_services"></a> [trusted\_role\_services](#input\_trusted\_role\_services) | AWS Services that can assume these roles | `list(string)` | `[]` | no |
7171

7272
## Outputs

modules/iam-assumable-roles/variables.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
variable "trusted_role_actions" {
2-
description = "Actions of STS"
2+
description = "Additional trusted role actions"
33
type = list(string)
44
default = ["sts:AssumeRole", "sts:TagSession"]
55
}
66

7+
variable "trusted_role_arns" {
8+
description = "ARNs of AWS entities who can assume these roles"
9+
type = list(string)
10+
default = []
11+
}
12+
713
variable "trusted_role_services" {
814
description = "AWS Services that can assume these roles"
915
type = list(string)
@@ -22,12 +28,6 @@ variable "allow_self_assume_role" {
2228
default = false
2329
}
2430

25-
variable "trusted_role_actions" {
26-
description = "Actions of STS"
27-
type = list(string)
28-
default = ["sts:AssumeRole"]
29-
}
30-
3131
# Admin
3232
variable "create_admin_role" {
3333
description = "Whether to create admin role"

wrappers/iam-assumable-role-with-saml/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ module "wrapper" {
1818
number_of_role_policy_arns = try(each.value.number_of_role_policy_arns, var.defaults.number_of_role_policy_arns, null)
1919
force_detach_policies = try(each.value.force_detach_policies, var.defaults.force_detach_policies, false)
2020
allow_self_assume_role = try(each.value.allow_self_assume_role, var.defaults.allow_self_assume_role, false)
21-
trusted_role_actions = try(each.value.trusted_role_actions, var.defaults.trusted_role_actions, ["sts:AssumeRoleWithSAML", "sts:TagSession"])
21+
actions = try(each.value.actions, var.defaults.actions, ["sts:AssumeRoleWithSAML", "sts:TagSession"])
2222
}

wrappers/iam-assumable-roles/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module "wrapper" {
33

44
for_each = var.items
55

6-
trusted_role_arns = try(each.value.trusted_role_arns, var.defaults.trusted_role_arns, [])
6+
trusted_role_actions = try(each.value.trusted_role_actions, var.defaults.trusted_role_actions, ["sts:AssumeRole", "sts:TagSession"])
77
trusted_role_services = try(each.value.trusted_role_services, var.defaults.trusted_role_services, [])
88
mfa_age = try(each.value.mfa_age, var.defaults.mfa_age, 86400)
99
allow_self_assume_role = try(each.value.allow_self_assume_role, var.defaults.allow_self_assume_role, false)

0 commit comments

Comments
 (0)