|
1 | | -# This is a special provider configuration that allows us to use many different |
2 | | -# versions of the Cloud Posse reference architecture to deploy this component |
3 | | -# in any account, including the identity and root accounts. |
| 1 | +# This component is unusual in that part of it must be deployed to the `root` |
| 2 | +# account. You have the option of where to deploy the remaining part, and |
| 3 | +# Cloud Posse recommends you deploy it also to the `root` account, however |
| 4 | +# it can be deployed to the `identity` account instead. In the discussion |
| 5 | +# below, when we talk about where this module is being deployed, we are |
| 6 | +# referring to the part of the module that is not deployed to the `root` |
| 7 | +# account and is configured by setting `stage` etc.. |
4 | 8 |
|
5 | | -# If you have dynamic Terraform roles enabled and an `aws-team` (such as `managers`) |
6 | | -# empowered to make changes in the identity and root accounts. Then you can |
7 | | -# use those roles to deploy this component in the identity and root accounts, |
8 | | -# just like almost any other component. Leave `privileged: false` and leave the |
9 | | -# backend `role_arn` at its default value. |
| 9 | +# If you have Dynamic Terraform Roles enabled, leave the backend `role_arn` at |
| 10 | +# its default value. If deploying only to the `root` account, leave `privileged: false` |
| 11 | +# and use either SuperAdmin or an appropriate `aws-team` (such as `managers`). |
| 12 | +# If deploying to the `identity` account, set `privileged: true` |
| 13 | +# and use SuperAdmin or any other role in the `root` account with Admin access. |
10 | 14 | # |
11 | 15 | # For those not using dynamic Terraform roles: |
12 | 16 | # |
13 | | -# If you are deploying this to the "identity" account and are restricted to using |
14 | | -# the SuperAdmin role to deploy components to "identity", then you will need to |
15 | | -# set the stack configuration for this component to set `privileged: true` |
16 | | -# and backend `role_arn` to `null`. |
| 17 | +# Set the stack configuration for this component to set `privileged: true` |
| 18 | +# and backend `role_arn` to `null`, and deploy it using either the SuperAdmin |
| 19 | +# role or any other role in the `root` account with Admin access. |
17 | 20 | # |
18 | 21 | # If you are deploying this to the "identity" account and have a team empowered |
19 | | -# to deploy components to "identity", then you will need to set the stack |
20 | | -# configuration for this component to set `privileged: false` and leave the |
21 | | -# backend `role_arn` at its default value. |
| 22 | +# to deploy to both the "identity" and "root" accounts, then you have the option to set |
| 23 | +# `privileged: false` and leave the backend `role_arn` at its default value, but |
| 24 | +# then SuperAdmin will not be able to deploy this component, |
| 25 | +# only the team with access to both accounts will be able to deploy it. |
22 | 26 | # |
23 | | -# If you are deploying this to the "root" account, then you will need to |
24 | | -# set the stack configuration for this component to set `privileged: true` |
25 | | -# and backend `role_arn` to `null`, and deploy it using either the SuperAdmin |
26 | | -# role or any other role in the `root` account with Admin access. |
27 | 27 |
|
28 | 28 | provider "aws" { |
29 | 29 | region = var.region |
@@ -51,10 +51,10 @@ provider "aws" { |
51 | 51 | alias = "root" |
52 | 52 | region = var.region |
53 | 53 |
|
54 | | - profile = !var.privileged && module.iam_roles.profiles_enabled ? module.iam_roles.terraform_profile_name : null |
| 54 | + profile = !var.privileged && module.iam_roles_root.profiles_enabled ? module.iam_roles_root.terraform_profile_name : null |
55 | 55 | dynamic "assume_role" { |
56 | | - for_each = !var.privileged && module.iam_roles.profiles_enabled ? [] : ( |
57 | | - var.privileged ? compact([module.iam_roles.org_role_arn]) : compact([module.iam_roles.terraform_role_arn]) |
| 56 | + for_each = !var.privileged && module.iam_roles_root.profiles_enabled ? [] : ( |
| 57 | + var.privileged ? compact([module.iam_roles_root.org_role_arn]) : compact([module.iam_roles_root.terraform_role_arn]) |
58 | 58 | ) |
59 | 59 | content { |
60 | 60 | role_arn = assume_role.value |
|
0 commit comments