Skip to content

Commit ec9904e

Browse files
authored
Feature: New Docs for account setup (#896)
1 parent f36a8a8 commit ec9904e

File tree

2 files changed

+54
-33
lines changed

2 files changed

+54
-33
lines changed

docs/layers/accounts/deploy-accounts.mdx

Lines changed: 53 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ import PrimaryCTA from '@site/src/components/PrimaryCTA';
1919
This guide walks through deploying AWS accounts using `atmos` workflows. Before starting, ensure you have completed the [Prepare AWS Organization](/layers/accounts/prepare-aws-organization/) guide, which creates the AWS Organization, enables AWS RAM sharing, and raises account limits.
2020
</Intro>
2121

22-
| Steps | Actions |
23-
| ---------------------------- | --------------------------------------------------------------------------- |
24-
| Validate prerequisites | Review account configuration |
25-
| Import AWS Organization | `atmos terraform import account -s core-gbl-root ...` |
26-
| Deploy accounts | `atmos workflow deploy/accounts -f quickstart/foundation/accounts` |
27-
| Deploy accounts settings | `atmos workflow deploy/account-settings -f quickstart/foundation/accounts` |
28-
| Finalize account setup | Click Ops (optional) |
22+
| Steps | Actions |
23+
| --------------------------------- | -------------------------------------------------------------------------------- |
24+
| Validate prerequisites | Review account configuration |
25+
| Deploy Organization | `atmos workflow deploy/organization -f quickstart/foundation/accounts` |
26+
| Deploy Organizational Units | `atmos workflow deploy/organizational-units -f quickstart/foundation/accounts` |
27+
| Deploy accounts | `atmos workflow deploy/accounts -f quickstart/foundation/accounts` |
28+
| Deploy Service Control Policies | `atmos workflow deploy/scps -f quickstart/foundation/accounts` |
29+
| Update Account ID Placeholders | Update `_defaults.yaml` with real account IDs |
30+
| Deploy account settings | `atmos workflow deploy/aws-account-settings -f quickstart/foundation/accounts` |
31+
| Finalize account setup | Click Ops (optional) |
2932

3033
<Steps>
3134
<Step>
@@ -40,70 +43,87 @@ This guide walks through deploying AWS accounts using `atmos` workflows. Before
4043
- Terraform state backend has been initialized
4144
</TaskList>
4245

43-
Next, review the "account" configuration in the stack catalog. **This is the hardest part to change/fix once the accounts are provisioned**. If you aren't confident about the email configuration, account names, or anything else, now is the time to make changes or ask for help.
46+
Next, review the account configuration in the stack catalog. The reference architecture uses individual **instanced components** for each account (`aws-account/core-artifacts`, `aws-account/plat-dev`, etc.) rather than a single monolithic component. Each account is defined as a separate component instance, inheriting shared defaults from `stacks/catalog/aws-account/defaults.yaml`.
47+
48+
**This is the hardest part to change/fix once the accounts are provisioned**. If you aren't confident about the email configuration, account names, or anything else, now is the time to make changes or ask for help.
4449

4550
You should double-check the following:
4651

4752
<TaskList>
48-
- Check that `stacks/catalog/account.yaml` has the values you expect, especially account email format
49-
- Run `atmos describe component account -s core-gbl-root` to inspect the final component configuration (e.g. _after_ all the mixins have been imported)
50-
- Plan the run with `atmos terraform plan account -s core-gbl-root`
53+
- Check that `stacks/catalog/aws-account/defaults.yaml` has the values you expect, especially account email format
54+
- Run `atmos describe component aws-account/core-artifacts -s core-gbl-root` to inspect the final component configuration (e.g. _after_ all the mixins have been imported)
55+
- Plan the run with `atmos terraform plan aws-account/core-artifacts -s core-gbl-root`
5156
</TaskList>
5257
</Step>
5358

5459
<Step>
55-
## <StepNumber/> Import the AWS Organization
60+
## <StepNumber/> Deploy the AWS Organization
5661

57-
The AWS Organization was created manually as part of the [Prepare AWS Organization](/layers/accounts/prepare-aws-organization/) guide. Now we need to import this existing organization into Terraform so it can be managed as infrastructure-as-code.
62+
The AWS Organization was created manually as part of the [Prepare AWS Organization](/layers/accounts/prepare-aws-organization/) guide. The `aws-organization` component uses the `import_resource_id` variable to import the existing organization into Terraform state on the first apply — no manual `terraform import` command is needed.
5863

59-
Import the existing AWS Organization into Terraform state using the following command. Replace `ORG_ID` with your AWS Organization ID (e.g., `o-abc123def4`):
64+
Before running this workflow, ensure `import_resource_id` is set to your AWS Organization ID in the stack configuration. You can find your Organization ID in the AWS Console under **AWS Organizations****Settings**, or by running:
6065

61-
```bash
62-
atmos terraform import account -s core-gbl-root "aws_organizations_organization.this[0]" ORG_ID
63-
```
64-
65-
:::info Finding Your Organization ID
66-
You can find your Organization ID in the AWS Console under **AWS Organizations****Settings**, or by running:
6766
```bash
6867
aws organizations describe-organization --query 'Organization.Id' --output text
6968
```
70-
:::
7169

72-
This command runs `terraform import` to bring the existing AWS Organization under Terraform management. After this step, all organization-level changes will be managed through Atmos and Terraform.
70+
This workflow also enables RAM sharing with the AWS Organization.
7371

74-
:::tip Verify Import
75-
After the import completes, verify the organization was imported successfully:
72+
<AtmosWorkflow workflow="deploy/organization" fileName="quickstart/foundation/accounts" />
73+
74+
:::tip Verify Deployment
75+
After the workflow completes, verify the organization is under management with no drift:
7676
```bash
77-
atmos terraform plan account -s core-gbl-root
77+
atmos terraform plan aws-organization -s core-gbl-root
7878
```
79-
The plan should show no changes for the organization resource, indicating it was imported correctly.
79+
The plan should show no changes, indicating the organization was imported and configured correctly.
8080
:::
8181
</Step>
8282

83+
<Step>
84+
## <StepNumber/> Deploy Organizational Units
85+
86+
Organizational Units (OUs) group your accounts by function. The reference architecture uses separate `aws-organizational-unit/*` instanced components for each OU (e.g. `core` and `plat`). The OU IDs are consumed by the account components via `!terraform.state`.
87+
88+
Like the organization component, each `aws-organizational-unit/*` component supports `import_resource_id` if you need to adopt existing OUs into Terraform management.
89+
90+
<AtmosWorkflow workflow="deploy/organizational-units" fileName="quickstart/foundation/accounts" />
91+
</Step>
92+
8393
<Step>
8494
## <StepNumber/> Deploy Accounts
8595

86-
Again review the "account" configuration in `stacks/catalog/account.yaml`. In particular, check the email address and account names. In the next step, we will create and configure all accounts in the AWS Organization using the configuration in that stack file.
96+
Review the account configuration one final time before creating accounts. Each account is provisioned as a separate instanced component (e.g. `aws-account/core-artifacts`, `aws-account/plat-dev`). In particular, check the email addresses and account names.
97+
98+
Each `aws-account/*` component also supports `import_resource_id` if you need to adopt existing accounts into Terraform management.
8799

88100
Once confident, begin the accounts deployment:
89101

90102
<AtmosWorkflow workflow="deploy/accounts" fileName="quickstart/foundation/accounts" />
91103

92104
This workflow creates all AWS member accounts in the AWS Organization using the configuration in your stack files.
105+
</Step>
93106

107+
<Step>
108+
## <StepNumber/> Deploy Service Control Policies
109+
110+
Service Control Policies (SCPs) set permission guardrails across your organization. This workflow deploys policies that prevent accounts from leaving the organization and restrict IAM user creation.
111+
112+
<AtmosWorkflow workflow="deploy/scps" fileName="quickstart/foundation/accounts" />
94113
</Step>
95114

96115
<Step>
97116
## <StepNumber/> Update Account ID Placeholders
98117

99118
Now that accounts are created, you have real account IDs to work with. The reference architecture contains placeholder account IDs that need to be replaced with your actual values.
100119

101-
To get your account IDs, run:
120+
To get your account IDs, run the output command for any account component:
102121

103122
```bash
104-
atmos terraform output account -s core-gbl-root
105-
## or if on the latest version with instanced components:
106123
atmos terraform output aws-account/core-artifacts -s core-gbl-root
124+
atmos terraform output aws-account/core-audit -s core-gbl-root
125+
atmos terraform output aws-account/plat-dev -s core-gbl-root
126+
# ... repeat for each account
107127
```
108128

109129
**Update the Static Account Map**
@@ -167,16 +187,16 @@ This guide walks through deploying AWS accounts using `atmos` workflows. Before
167187
</Step>
168188

169189
<Step>
170-
## <StepNumber/> Deploy Accounts Settings
190+
## <StepNumber/> Deploy Account Settings
171191

172192
Once you've created the accounts, you'll need to provision the baseline configuration within the accounts themselves. Run the following:
173193

174-
<AtmosWorkflow workflow="deploy/account-settings" fileName="quickstart/foundation/accounts" />
194+
<AtmosWorkflow workflow="deploy/aws-account-settings" fileName="quickstart/foundation/accounts" />
175195

176196
The workflows will kick off several sequential Terraform runs to provision all the AWS member account settings for
177197
member accounts in the Organization.
178198
</Step>
179-
199+
180200
<Step>
181201
## <StepNumber/> Unsubscribe from Marketing Emails (Optional)
182202

examples/snippets/stacks/workflows/quickstart/foundation/accounts.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ workflows:
9696
description: Deploy Service Control Policies
9797
steps:
9898
- command: terraform deploy aws-scp/deny-leaving-organization -s core-gbl-root
99+
- command: terraform deploy aws-scp/deny-creating-users -s core-gbl-root
99100

100101
deploy/aws-account-settings:
101102
description: Apply AWS Account settings for best practices.

0 commit comments

Comments
 (0)