Skip to content

Commit

Permalink
Feat/setup sso superset (#313)
Browse files Browse the repository at this point in the history
* feat: add superset prod account id

* feat: create the Superset prod groups

* feat: setup the groups/permissions assignments
  • Loading branch information
gcharest authored Oct 8, 2024
1 parent 431ad93 commit 6beee2e
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions terragrunt/org_account/iam_identity_center/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ locals {
notify_dev_account_id = "800095993820"
notify_sandbox_account_id = "891376947407"

superset_production_account_id = "066023111852"

sso_identity_store_id = "d-9d67173bdd"
sso_instance_id = "ssoins-8824c710b5ddb452"
sso_instance_arn = "arn:aws:sso:::instance/${local.sso_instance_id}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# Accounts: assign permissions
#
locals {
# Superset-Production
superset_production_permission_sets = [
{
group = aws_identitystore_group.superset_production_admin,
permission_set = data.aws_ssoadmin_permission_set.aws_administrator_access,
},
{
group = aws_identitystore_group.superset_production_read_only_billing,
permission_set = aws_ssoadmin_permission_set.read_only_billing,
},
{
group = aws_identitystore_group.superset_production_read_only,
permission_set = data.aws_ssoadmin_permission_set.aws_read_only_access,
}
]
}


resource "aws_ssoadmin_account_assignment" "superset_production" {
for_each = { for perm in local.superset_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.superset_production_account_id
target_type = "AWS_ACCOUNT"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Production
#
resource "aws_identitystore_group" "superset_production_admin" {
display_name = "Superset-Production-Admin"
description = "Grants members administrator access to the Superset Production account."
identity_store_id = local.sso_identity_store_id
}

resource "aws_identitystore_group" "superset_production_read_only_billing" {
display_name = "Superset-Production-Billing-ReadOnly"
description = "Grants members read-only Billing and Cost Explorer access to the Superset Production account."
identity_store_id = local.sso_identity_store_id
}

resource "aws_identitystore_group" "superset_production_read_only" {
display_name = "Superset-Production-ReadOnly"
description = "Grants members read-only access to the Superset Production account."
identity_store_id = local.sso_identity_store_id
}

0 comments on commit 6beee2e

Please sign in to comment.