Skip to content

Commit 268865e

Browse files
♻️ refactor: split monolithic account component into modular components (#864)
2 parents 17710ef + 18b0d11 commit 268865e

1 file changed

Lines changed: 65 additions & 18 deletions

File tree

  • examples/snippets/stacks/workflows/quickstart/foundation

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

Lines changed: 65 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# - deploy/tfstate: Deploy Terraform state backend
1818
# - deploy/organization: Create AWS Organization
1919
# - deploy/accounts: Provision AWS accounts
20-
# - deploy/account-settings: Configure account settings
20+
# - deploy/aws-account-settings: Configure account settings
2121
# - deploy/cloudtrail: Enable CloudTrail logging
2222
# - deploy/ecr: Deploy ECR registry
2323
#
@@ -29,17 +29,24 @@ workflows:
2929
- command: workflow init/tfstate -f quickstart/foundation/accounts
3030
- command: workflow deploy/tfstate -f quickstart/foundation/accounts
3131
- command: workflow deploy/organization -f quickstart/foundation/accounts
32+
- command: workflow deploy/organizational-units -f quickstart/foundation/accounts
3233
- command: workflow deploy/accounts -f quickstart/foundation/accounts
33-
- command: workflow deploy/account-settings -f quickstart/foundation/accounts
34+
- command: workflow deploy/scps -f quickstart/foundation/accounts
35+
- command: workflow deploy/aws-account-settings -f quickstart/foundation/accounts
36+
- command: workflow deploy/budgets -f quickstart/foundation/accounts
3437
- command: workflow deploy/cloudtrail -f quickstart/foundation/accounts
3538
- command: workflow deploy/ecr -f quickstart/foundation/accounts
3639

3740
vendor:
3841
description: Vendor accounts layer components.
3942
steps:
40-
- command: vendor pull --component account
43+
- command: vendor pull --component aws-organization
44+
- command: vendor pull --component aws-organizational-unit
45+
- command: vendor pull --component aws-account
46+
- command: vendor pull --component aws-scp
47+
- command: vendor pull --component aws-budget
4148
- command: vendor pull --component account-quotas
42-
- command: vendor pull --component account-settings
49+
- command: vendor pull --component aws-account-settings
4350
- command: vendor pull --component cloudtrail
4451
- command: vendor pull --component cloudtrail-bucket
4552
- command: vendor pull --component ecr
@@ -62,29 +69,69 @@ workflows:
6269
description: |
6370
Deploy the AWS Organization. This is required before finishing the root account requirements.
6471
steps:
65-
- command: terraform deploy account -target="aws_organizations_organization.this[0]" -s core-gbl-root
72+
- command: terraform deploy aws-organization -s core-gbl-root
6673
- command: aws ram enable-sharing-with-aws-organization
6774
type: shell
6875

76+
deploy/organizational-units:
77+
description: Deploy Organizational Units
78+
steps:
79+
- command: terraform deploy aws-organizational-unit/core -s core-gbl-root
80+
- command: terraform deploy aws-organizational-unit/plat -s core-gbl-root
81+
6982
deploy/accounts:
7083
description: Deploys all AWS Organization accounts
7184
steps:
72-
- command: terraform apply account -s core-gbl-root
85+
- command: terraform deploy aws-account/core-artifacts -s core-gbl-root
86+
- command: terraform deploy aws-account/core-audit -s core-gbl-root
87+
- command: terraform deploy aws-account/core-auto -s core-gbl-root
88+
- command: terraform deploy aws-account/core-dns -s core-gbl-root
89+
- command: terraform deploy aws-account/core-network -s core-gbl-root
90+
- command: terraform deploy aws-account/core-security -s core-gbl-root
91+
- command: terraform deploy aws-account/plat-dev -s core-gbl-root
92+
- command: terraform deploy aws-account/plat-sandbox -s core-gbl-root
93+
- command: terraform deploy aws-account/plat-staging -s core-gbl-root
94+
- command: terraform deploy aws-account/plat-prod -s core-gbl-root
95+
96+
deploy/scps:
97+
description: Deploy Service Control Policies
98+
steps:
99+
- command: terraform deploy aws-scp/deny-leaving-organization-core -s core-gbl-root
100+
- command: terraform deploy aws-scp/deny-iam-root-account-core -s core-gbl-root
101+
- command: terraform deploy aws-scp/deny-iam-creating-users-core -s core-gbl-root
102+
- command: terraform deploy aws-scp/deny-leaving-organization-plat -s core-gbl-root
103+
- command: terraform deploy aws-scp/deny-iam-root-account-plat -s core-gbl-root
104+
- command: terraform deploy aws-scp/deny-iam-creating-users-plat -s core-gbl-root
73105

74-
deploy/account-settings:
106+
deploy/aws-account-settings:
75107
description: Apply AWS Account settings for best practices.
76108
steps:
77-
- command: terraform deploy account-settings -s core-gbl-artifacts
78-
- command: terraform deploy account-settings -s core-gbl-audit
79-
- command: terraform deploy account-settings -s core-gbl-auto
80-
- command: terraform deploy account-settings -s core-gbl-dns
81-
- command: terraform deploy account-settings -s core-gbl-network
82-
- command: terraform deploy account-settings -s core-gbl-root
83-
- command: terraform deploy account-settings -s core-gbl-security
84-
- command: terraform deploy account-settings -s plat-gbl-dev
85-
- command: terraform deploy account-settings -s plat-gbl-prod
86-
- command: terraform deploy account-settings -s plat-gbl-sandbox
87-
- command: terraform deploy account-settings -s plat-gbl-staging
109+
- command: terraform deploy aws-account-settings -s core-gbl-artifacts
110+
- command: terraform deploy aws-account-settings -s core-gbl-audit
111+
- command: terraform deploy aws-account-settings -s core-gbl-auto
112+
- command: terraform deploy aws-account-settings -s core-gbl-dns
113+
- command: terraform deploy aws-account-settings -s core-gbl-network
114+
- command: terraform deploy aws-account-settings -s core-gbl-root
115+
- command: terraform deploy aws-account-settings -s core-gbl-security
116+
- command: terraform deploy aws-account-settings -s plat-gbl-dev
117+
- command: terraform deploy aws-account-settings -s plat-gbl-prod
118+
- command: terraform deploy aws-account-settings -s plat-gbl-sandbox
119+
- command: terraform deploy aws-account-settings -s plat-gbl-staging
120+
121+
deploy/budgets:
122+
description: Deploy budgets to all accounts
123+
steps:
124+
- command: terraform deploy aws-budget -s core-gbl-root
125+
- command: terraform deploy aws-budget -s core-gbl-artifacts
126+
- command: terraform deploy aws-budget -s core-gbl-audit
127+
- command: terraform deploy aws-budget -s core-gbl-auto
128+
- command: terraform deploy aws-budget -s core-gbl-dns
129+
- command: terraform deploy aws-budget -s core-gbl-network
130+
- command: terraform deploy aws-budget -s core-gbl-security
131+
- command: terraform deploy aws-budget -s plat-gbl-dev
132+
- command: terraform deploy aws-budget -s plat-gbl-sandbox
133+
- command: terraform deploy aws-budget -s plat-gbl-staging
134+
- command: terraform deploy aws-budget -s plat-gbl-prod
88135

89136
deploy/cloudtrail:
90137
description: Start AWS Cloudtrail in audit and root accounts to track changes across the org.

0 commit comments

Comments
 (0)