Skip to content

Commit 8dd6af9

Browse files
Merge pull request #23 from infraspecdev/fix/account-id-assignment-example
fix: Update the example to use the account ID assignment as per module
2 parents dce9c9d + 28b0531 commit 8dd6af9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/assign-users-and-groups-to-account/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ No resources.
3636

3737
| Name | Description | Type | Default | Required |
3838
|------|-------------|------|---------|:--------:|
39-
| <a name="input_account_assignments"></a> [account\_assignments](#input\_account\_assignments) | A list of objects representing permission assignments for AWS SSO. Each object contains the following attributes:<br> - account\_id: The AWS account ID where the permissions will be applied.<br> - permission\_sets: List of permission-set to be assigned to the specified principals.<br> - principal\_names: An identifier for an object in AWS SSO, such as the names of groups or users .<br> -principal\_type: The entity type for which the assignment will be created. Valid values: USER, GROUP. | <pre>list(object({<br> account_id = string<br> permission_sets = list(string)<br> principal_names = list(string)<br> principal_type = string<br> }))</pre> | <pre>[<br> {<br> "account_id": "121212121212",<br> "permission_sets": [<br> "StagingDev"<br> ],<br> "principal_names": [<br> "Staging_Dev"<br> ],<br> "principal_type": "GROUP"<br> }<br>]</pre> | no |
39+
| <a name="input_account_assignments"></a> [account\_assignments](#input\_account\_assignments) | A list of objects representing permission assignments for AWS SSO. Each object contains the following attributes:<br> - account\_name: The AWS account where the permissions will be applied.<br> - permission\_sets: List of permission-set to be assigned to the specified principals.<br> - principal\_names: An identifier for an object in AWS SSO, such as the names of groups or users .<br> -principal\_type: The entity type for which the assignment will be created. Valid values: USER, GROUP. | <pre>list(object({<br> account_name = string<br> permission_sets = list(string)<br> principal_names = list(string)<br> principal_type = string<br> }))</pre> | <pre>[<br> {<br> "account_name": "staging",<br> "permission_sets": [<br> "StagingDev"<br> ],<br> "principal_names": [<br> "Staging_Dev"<br> ],<br> "principal_type": "GROUP"<br> }<br>]</pre> | no |
4040

4141
## Outputs
4242

examples/assign-users-and-groups-to-account/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
variable "account_assignments" {
22
description = <<EOF
33
A list of objects representing permission assignments for AWS SSO. Each object contains the following attributes:
4-
- account_id: The AWS account ID where the permissions will be applied.
4+
- account_name: The AWS account where the permissions will be applied.
55
- permission_sets: List of permission-set to be assigned to the specified principals.
66
- principal_names: An identifier for an object in AWS SSO, such as the names of groups or users .
77
-principal_type: The entity type for which the assignment will be created. Valid values: USER, GROUP.
88
EOF
99
type = list(object({
10-
account_id = string
10+
account_name = string
1111
permission_sets = list(string)
1212
principal_names = list(string)
1313
principal_type = string
1414
}))
1515
default = [
1616
{
17-
account_id = "121212121212"
17+
account_name = "staging"
1818
permission_sets = ["StagingDev"]
1919
principal_names = ["Staging_Dev"]
2020
principal_type = "GROUP"

modules/account_users_and_groups_assignments/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ locals {
1010
for acc_assignment in var.account_assignments : [
1111
for ps_name in acc_assignment.permission_sets : [
1212
for pr_name in acc_assignment.principal_names : {
13-
acc_id = account_map[acc_assignment.account_name]
13+
acc_id = local.account_map[acc_assignment.account_name]
1414
principal_name = pr_name
1515
ps_name = ps_name
1616
principal_type = acc_assignment.principal_type

0 commit comments

Comments
 (0)