Submodule roles-to-principals
This submodule is used by other modules to map short role names and AWS SSO Permission Set names in accounts designated
by short account names (for example, terraform
in the dev
account) to full IAM Role ARNs and other related tasks.
Special Configuration Needed
As with iam-roles
, in order to avoid having to pass customization information through every module that uses this
submodule, if the default configuration does not suit your needs, you are expected to add variables_override.tf
to
override the variables with the defaults you want to use in your project. For example, if you are not using "core" as
the tenant
portion of your "root" account (your Organization Management Account), then you should include the
variable "overridable_global_tenant_name"
declaration in your variables_override.tf
so that
overridable_global_tenant_name
defaults to the value you are using (or the empty string if you are not using tenant
at all).
Variables
Required Variables
Optional Variables
overridable_global_environment_name
(string
) optionalGlobal environment name
Default value:
"gbl"
overridable_global_stage_name
(string
) optionalThe stage name for the organization management account (where the
account-map
state is stored)Default value:
"root"
overridable_global_tenant_name
(string
) optionalThe tenant name used for organization-wide resources
Default value:
"core"
overridable_team_permission_set_name_pattern
(string
) optionalThe pattern used to generate the AWS SSO PermissionSet name for each team
Default value:
"Identity%sTeamAccess"
overridable_team_permission_sets_enabled
(bool
) optionalWhen true, any roles (teams or team-roles) in the identity account references in
role_map
will cause corresponding AWS SSO PermissionSets to be included in thepermission_set_arn_like
output.
This has the effect of treating those PermissionSets as if they were teams.
The main reason to set thisfalse
is if IAM trust policies are exceeding size limits and you are not using AWS SSO.Default value:
true
permission_set_map
(map(list(string))
) optionalMap of account:[PermissionSet, PermissionSet...] specifying AWS SSO PermissionSets when accessed from specified accounts
Default value:
{ }
privileged
(bool
) optionalTrue if the default provider already has access to the backend
Default value:
false
role_map
(map(list(string))
) optionalMap of account:[role, role...]. Use
*
as role for entire accountDefault value:
{ }
teams
(list(string)
) optionalList of team names to translate to AWS SSO PermissionSet names
Default value:
[ ]
Context Variables
The following variables are defined in the context.tf
file of this module and part of the terraform-null-label pattern.
context.tf
file of this module and part of the terraform-null-label pattern.Outputs
aws_partition
The AWS "partition" to use when constructing resource ARNs
full_account_map
Map of account names to account IDs
permission_set_arn_like
List of Role ARN regexes suitable for IAM Condition
ArnLike
corresponding to given inputpermission_set_map
principals
Consolidated list of AWS principals corresponding to given input
role_map
principals_map
Map of AWS principals corresponding to given input
role_map
team_permission_set_name_map
Map of team names (from
var.teams
and `role_map["identity"]) to permission set names
Dependencies
Modules
Name | Version | Source | Description |
---|---|---|---|
account_map | 1.8.0 | cloudposse/stack-config/yaml//modules/remote-state | n/a |
always | 0.25.0 | cloudposse/label/null | n/a |
this | 0.25.0 | cloudposse/label/null | n/a |
None