You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add backend.privileged attribute to the backend config in YAML stack config (#30)
* Add `backend.privileged` attribute to the `backend` config in YAML stack config
* Add `backend.privileged` attribute to the `backend` config in YAML stack config
* Auto Format
* Add `backend.privileged` attribute to the `backend` config in YAML stack config
* Auto Format
* Add `backend.privileged` attribute to the `backend` config in YAML stack config
Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>
# Privileged components are those that require elevated (root-level) permissions to provision and access their remote state.
25
+
# For example: `tfstate-backend`, `account`, `account-map`, `account-settings`, `iam-primary`.
26
+
# Privileged components are usually provisioned during cold-start (when we don't have any IAM roles provisioned yet) by using an admin user credentials.
27
+
# To access the remote state of privileged components, the caller needs to have permissions to access the backend and the remote state without assuming roles.
28
+
# Regular components, on the other hand, don't require root-level permissions and are provisioned and their remote state is accessed by assuming IAM roles (or using profiles).
29
+
# For example: `vpc`, `eks`, `rds`
30
+
31
+
# NOTE: global `backend` config
32
+
# The global `backend` config should be declared in a global YAML stack config file (e.g. `globals.yaml`)
33
+
# where all stacks can import it and have access to it (note that the global `backend` config is organization-wide and will not change after cold-start).
34
+
# The global `backend` config in the global config file should always have the `role_arn` or `profile` specified (added after the cold-start).
35
+
36
+
# NOTE: components `backend` config
37
+
# The `backend` portion for each individual component should be declared in a catalog file (e.g. `stacks/catalog/<component>.yaml`)
38
+
# along with all the default values for a component.
39
+
# The `privileged` attribute should always be declared in the `backend` portion for each individual component in the catalog.
40
+
# Top-level stacks where a component is provisioned import the component's catalog (the default values and the component's backend config portion) and can override the default value.
41
+
42
+
# NOTE: `cold-start`
43
+
# During cold-start we don't have any IAM roles provisioned yet, so we use an admin user credentials to provision the privileged components.
44
+
# The `privileged` attribute for the privileged components should be set to `true` in the components' catalog,
45
+
# and the privileged components should be provisioned using an admin user credentials.
46
+
47
+
# NOTE: after `cold-start`
48
+
# After the privileged components (including the primary IAM roles) are provisioned, we update the global `backend` config in the global config file
49
+
# to add the IAM role or profile to access the backend (after this, the global `backend` config should never change).
50
+
# For some privileged components we can change the `privileged` attribute in the YAML config from `true` to `false`
51
+
# to allow the regular components to access their remote state (e.g. we set the `privileged` attribute to `false` in the `account-map` component
52
+
# since we use `account-map` in almost all regular components.
53
+
# For each regular component, set the `privileged` attribute to `false` in the components' portion of `backend` config (in `stacks/catalog/<component>.yaml`)
54
+
55
+
# Advantages:
56
+
# The global `backend` config is specified just once in the global config file, IAM role or profile is added to it after the cold start,
57
+
# and after that the global `backend` config never changed.
58
+
# We can make a component privileged or not any time by just updating its `privileged` attribute in the component's catalog file.
59
+
# We can change a component's `backend` portion any time without touching/affection the backend configs of all other components (e.g. when we add a new
60
+
# component, we don't touch the `globals.yaml` file at all, and we don't update the component's `role_arn` and `profile` settings).
61
+
62
+
# Use the role to access the remote state if the component is not privileged and `role_arn` is specified
0 commit comments