In this example with yaml conf...
module "iam_identity_center" {
source = "voidsolutionsorg/iam-identity-center/aws"
version = "1.0.0"
# variables are configured via yaml files inside "conf" folder
}
# conf/attachments.yaml
---
# attachments
attachments:
- permission_set_name: "AdministratorAccess"
principal_type: "GROUP"
principal_group_name: "Admin"
target_account_id: "ACCOUNT_ID" # account id
- permission_set_name: "CustomizedS3ReadAccessJsonPath"
principal_type: "GROUP"
principal_group_name: "TeamA"
target_account_id: "ACCOUNT_ID" # account id
# conf/groups.yaml
---
# groups
groups:
- name: "Admin"
description: "Description for admin group"
users: ["test.admin"]
- name: "TeamA"
description: "Description for team A"
users: ["teamA.user1", "teamA.user2"]
# conf/permission_sets.yaml
---
# permission_sets
permission_sets:
# managed policy and customer_managed_policy
- name: "AdministratorAccess"
description: "Description for administrator access"
managed_policies: ["arn:aws:iam::aws:policy/AdministratorAccess"]
customer_managed_policies:
- name: "customized_billing_policy" # imagine we have a policy in IAM
path: "/"
session_duration: "PT4H"
# example for inline with json path
- name: "CustomizedS3ReadAccessJsonPath"
description: "S3 read only"
inline_policy_json_path: "./policies/S3ReadCustomizedBucket.json"
session_duration: "PT4H"
boundary_policy:
type: "CUSTOMER_MANAGED"
customer_policy_name: "s3_boundary_customer_managed_policy" # imagine we have a policy in IAM
customer_policy_path: "/"
# conf/users.yaml
---
# users
users:
- display_name: "Display Name"
user_name: "test.admin"
name:
family_name: "Display"
given_name: "Name"
emails:
- primary: true
type: "AnyType"
value: "[email protected]"
- display_name: "Display Name"
user_name: "teamA.user1"
name:
family_name: "Display"
given_name: "Name"
emails:
- primary: true
type: "AnyType"
value: "[email protected]"
- display_name: "Display Name"
user_name: "teamA.user2"
name:
family_name: "Display"
given_name: "Name"
emails:
- primary: true
type: "AnyType"
value: "[email protected]"
In this example with standard tf variables...
module "iam_identity_center" {
source = "voidsolutionsorg/iam-identity-center/aws"
version = "1.0.0"
permission_sets = [
{ # managed policy and customer_managed_policy
name = "AdministratorAccess",
description = "Description for administrator access",
managed_policies = ["arn:aws:iam::aws:policy/AdministratorAccess"],
customer_managed_policies = [
{
name = "customized_billing_policy" # imagine we have a policy in IAM
path = "/"
}
]
session_duration = "PT4H"
},
{ # example for inline with json path
name = "CustomizedS3ReadAccessJsonPath",
description = "S3 read only",
inline_policy_json_path = "./policies/S3ReadCustomizedBucket.json"
session_duration = "PT4H"
boundary_policy = {
type = "CUSTOMER_MANAGED"
customer_policy_name = "s3_boundary_customer_managed_policy" # imagine we have a policy in IAM
customer_policy_path = "/"
}
},
{ # example for inline with json path
name = "CustomizedS3ReadAccessInline",
description = "S3 read only",
inline_policy = <<EOF
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Action":[
"s3:GetObject",
"s3:GetObjectVersion"
],
"Resource":"arn:aws:s3:::example/*"
}
]
}
EOF
session_duration = "PT4H"
boundary_policy = {
type = "MANAGED"
managed_policy_arn = "arn:aws:iam::aws:policy/S3ReadOnly"
}
}
]
users = [
{
display_name = "Display Name"
user_name = "test.admin"
name = {
family_name = "Display"
given_name = "Name"
}
emails = [
{
primary = true
type = "AnyType"
value = "[email protected]"
}
]
},
{
display_name = "Display Name"
user_name = "teamA.user1"
name = {
family_name = "Display"
given_name = "Name"
}
emails = [
{
primary = true
type = "AnyType"
value = "[email protected]"
}
]
},
{
display_name = "Display Name"
user_name = "teamA.user2"
name = {
family_name = "Display"
given_name = "Name"
}
emails = [
{
primary = true
type = "AnyType"
value = "[email protected]"
}
]
},
{
display_name = "Display Name"
user_name = "teamB.user1"
name = {
family_name = "Display"
given_name = "Name"
}
emails = [
{
primary = true
type = "AnyType"
value = "[email protected]"
}
]
}
]
groups = [
{
name = "Admin",
description = "Description for admin group",
users = ["test.admin"]
},
{
name = "TeamA",
description = "Description for team A",
users = ["teamA.user1", "teamA.user2"]
},
{
name = "TeamB",
description = "Description for team B",
users = ["teamB.user1", "teamB.user2"]
}
]
attachments = [
{
permission_set_name = "AdministratorAccess",
principal_type = "GROUP",
principal_group_name = "Admin",
target_account_id = "ACCOUNT_ID" # account id
},
{
permission_set_name = "CustomizedS3ReadAccessJsonPath",
principal_type = "GROUP",
principal_group_name = "TeamA",
target_account_id = "ACCOUNT_ID" # account id
},
{
permission_set_name = "CustomizedS3ReadAccessInline",
principal_type = "GROUP",
principal_group_name = "TeamB",
target_account_id = "ACCOUNT_ID" # account id
}
]
}
- Complete IAM Identity Center using yaml config files
- Complete IAM Identity Center using Terraform variables
Name | Version |
---|---|
terraform | >= 1.5.0 |
aws | ~> 5.0 |
Name | Version |
---|---|
aws | ~> 5.0 |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
attachments | The list of attachments | list(object({ |
[] |
no |
groups | The list of groups | list(object({ |
[] |
no |
permission_sets | The list of permission sets | list(object({ |
[] |
no |
users | The list of users | list(object({ |
[] |
no |
No outputs.
Module is maintained by Aleksa Siriški with help from the VoidSolutions team.
Module was originally made by Nikola Kolović with help from the CyberLab team.
Apache 2 Licensed. See LICENSE for full details.