generated from cds-snc/project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding DTO to the AWS SSO groups (#314)
* Adding DTO for AWS SSO * Formatting
- Loading branch information
1 parent
ed4c623
commit 706dfe9
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
terragrunt/org_account/iam_identity_center/digital_transformation_office_assignments.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# Accounts: assign permissions | ||
# | ||
locals { | ||
digital_transformation_office_production_permission_sets = [ | ||
{ | ||
group = aws_identitystore_group.digital_transformation_office_production_admin, | ||
permission_set = data.aws_ssoadmin_permission_set.aws_administrator_access, | ||
}, | ||
{ | ||
group = aws_identitystore_group.digital_transformation_office_production_read_only, | ||
permission_set = data.aws_ssoadmin_permission_set.aws_read_only_access, | ||
}, | ||
] | ||
} | ||
|
||
resource "aws_ssoadmin_account_assignment" "digital_transformation_office_production" { | ||
for_each = { for perm in local.digital_transformation_office_production_permission_sets : "${perm.group.display_name}-${perm.permission_set.name}" => perm } | ||
|
||
instance_arn = local.sso_instance_arn | ||
permission_set_arn = each.value.permission_set.arn | ||
|
||
principal_id = each.value.group.group_id | ||
principal_type = "GROUP" | ||
|
||
target_id = local.digital_transformation_office_production_account_id | ||
target_type = "AWS_ACCOUNT" | ||
} |
14 changes: 14 additions & 0 deletions
14
terragrunt/org_account/iam_identity_center/digital_transformation_office_groups.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Production | ||
# | ||
resource "aws_identitystore_group" "digital_transformation_office_production_admin" { | ||
display_name = "DigitalTransformationOffice-Production-Admin" | ||
description = "Grants members administrator access to the Digital Transformation Office Production account." | ||
identity_store_id = local.sso_identity_store_id | ||
} | ||
|
||
resource "aws_identitystore_group" "digital_transformation_office_production_read_only" { | ||
display_name = "DigitalTransformationOffice-Production-ReadOnly" | ||
description = "Grants members read-only access to the Digital Transformation Office Production account." | ||
identity_store_id = local.sso_identity_store_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters