AWS IAM Identity Center Terraform Module
Derived from aws-ia/terraform-aws-iam-identity-center v1.0.4 (Apache-2.0). See NOTICE.
Features
- Dynamic User Creation
- Dynamic Group Creation
- Dynamic Group Membership Creation
- Dynamic Permission Set Creation
- Dynamic Account Assignment Creation
- Dynamic Reference of Existing Users
- Dynamic Reference of Existing Groups
- AWS Managed Policy Support
- Customer Managed Policy Support
- Dynamic Application Creation (with Portal Options, Users and Groups assignments and Assignments Access Scopes configuration)
Important
- Locals are used to allow for global changes to multiple account assignments. If hard coding the account ids for your account assignments, you would need to change them in every place you want to reference the value. To simplify this, we recommend storing your desired account ids in local values. See the
examplesdirectory for more information and sample code. - When using Customer Managed Policies with account assignments, you must ensure these policies exist in all target accounts before using the module. Failure to do this will cause deployment errors because IAM Identity Center will attempt to reference policies that do not exist.
- The names of your object(s) (e.g. the groups or users you wish to create or reference) are used to reference them elsewhere within the module, such as referencing groups you wish to add users to, or permission sets you wish to use with your account assignments. While the names of these objects can be anything since they are just local references to the each object, ensure you reference the string exactly (case-sensitive) when using elsewhere in the module.
- However, for the actual names of the existing groups, users, etc. these must match exactly as they appear in your AWS IAM Identity Center configuration. This is because for these resources, a data source is being used to fetch information about the existing resource using a filter on the name.
- To simplify this and prevent confusion, we recommend using the same name for the object as the resource itself. See the following for an example:
sso_groups = {
Admin : {
group_name = "Admin"
group_description = "Admin IAM Identity Center Group"
},
}
// Create desired USERS in IAM Identity Center
sso_users = {
nuzumaki : {
group_membership = ["Admin",]
user_name = "nuzumaki"
given_name = "Naruto"
family_name = "Uzumaki"
email = "nuzumaki@hiddenleaf.village"
},
}
// Create desired Applications in IAM Identity Center
sso_applications = {
FirstApplication : {
application_provider_arn = "arn:aws:sso::aws:applicationProvider/custom"
description = "I am the First Application"
name = "FirstApplication"
portal_options = {
sign_in_options = {
application_url = "http://example.com"
origin = "APPLICATION"
}
visibility = "ENABLED"
}
status = "ENABLED"
assignment_required = true
assignments_access_scope = [
{
authorized_targets = ["FirstApplication"]
scope = "sso:account:access"
}
]
group_assignments = ["Dev"]
user_assignments = ["nuzumaki"]
}
}
The object/principal names are referenced throughout the module. Failure to follow this guidance may lead to unintentional errors such as the following:
Error: Invalid index
│
│ on ../../main.tf line 141, in resource "aws_identitystore_group_membership" "sso_group_membership":