2121# - deploy/cloudtrail: Enable CloudTrail logging
2222# - deploy/ecr: Deploy ECR registry
2323#
24+ # NOTE: Use 'superadmin' profile for initial infrastructure setup.
25+ # After SSO is configured and IAM roles are deployed (via identity layer),
26+ # update this to 'managers' for day-to-day operations.
2427workflows :
2528 all :
29+ env :
30+ ATMOS_PROFILE : superadmin
2631 description : Deploy complete accounts layer
2732 steps :
33+ - command : workflow initial-setup -f quickstart/foundation/accounts
2834 - command : workflow vendor -f quickstart/foundation/accounts
2935 - command : workflow init/tfstate -f quickstart/foundation/accounts
3036 - command : workflow deploy/tfstate -f quickstart/foundation/accounts
@@ -35,9 +41,41 @@ workflows:
3541 - command : workflow deploy/aws-account-settings -f quickstart/foundation/accounts
3642 - command : workflow deploy/budgets -f quickstart/foundation/accounts
3743 - command : workflow deploy/cloudtrail -f quickstart/foundation/accounts
44+ - command : vendor pull --component github-oidc-provider
45+ - command : workflow deploy/github-oidc-provider -f quickstart/foundation/identity
3846 - command : workflow deploy/ecr -f quickstart/foundation/accounts
3947
48+ initial-setup :
49+ description : Initial commands to run before deploying the accounts layer.
50+ env :
51+ ATMOS_PROFILE : superadmin
52+ ATMOS_IDENTITY : core-root/terraform
53+ steps :
54+ - command : auth login
55+ - command : auth whoami
56+ # Request increase for IAM service quota (This is always in us-east-1)
57+ - command : |
58+ QUOTA_VALUE=$(atmos auth exec --identity core-root/terraform -- \
59+ aws service-quotas get-service-quota \
60+ --service-code iam \
61+ --quota-code L-C07B4B0D \
62+ --region us-east-1 | jq '.Quota.Value')
63+
64+ if [[ "$QUOTA_VALUE" != "4096.0" ]]; then
65+ atmos auth exec --identity core-root/terraform -- \
66+ aws service-quotas request-service-quota-increase \
67+ --service-code iam \
68+ --quota-code L-C07B4B0D \
69+ --desired-value 4096 \
70+ --region us-east-1
71+ else
72+ echo "IAM service quota is already at 4096.0"
73+ fi
74+ type: shell
75+
4076 vendor :
77+ env :
78+ ATMOS_PROFILE : superadmin
4179 description : Vendor accounts layer components.
4280 steps :
4381 - command : vendor pull --component aws-organization
@@ -53,33 +91,44 @@ workflows:
5391 - command : vendor pull --component tfstate-backend
5492
5593 init/tfstate :
94+ env :
95+ ATMOS_PROFILE : superadmin
5696 description : Provision Terraform State Backend for initial deployment.
5797 steps :
98+ - command : terraform clean tfstate-backend --stack core-use1-root -f
5899 - command : terraform deploy tfstate-backend -var="access_roles_enabled=false" --stack core-use1-root --auto-generate-backend-file=false
59- - command : until aws s3 ls acme-core-use1-root-tfstate; do sleep 5; done
100+ - command : until atmos auth exec --identity core-root/terraform -- aws s3 ls acme-core-use1-root-tfstate; do sleep 5; done
60101 type : shell
61102 - command : terraform deploy tfstate-backend -var="access_roles_enabled=false" --stack core-use1-root --init-run-reconfigure=false
62103
63104 deploy/tfstate :
105+ env :
106+ ATMOS_PROFILE : superadmin
64107 description : Deploy Terraform State Backend.
65108 steps :
66109 - command : terraform deploy tfstate-backend --stack core-use1-root
67110
68111 deploy/organization :
112+ env :
113+ ATMOS_PROFILE : superadmin
69114 description : |
70115 Deploy the AWS Organization. This is required before finishing the root account requirements.
71116 steps :
72117 - command : terraform deploy aws-organization -s core-gbl-root
73- - command : aws ram enable-sharing-with-aws-organization
118+ - command : atmos auth exec --identity core-root/terraform -- aws ram enable-sharing-with-aws-organization
74119 type : shell
75120
76121 deploy/organizational-units :
122+ env :
123+ ATMOS_PROFILE : superadmin
77124 description : Deploy Organizational Units
78125 steps :
79126 - command : terraform deploy aws-organizational-unit/core -s core-gbl-root
80127 - command : terraform deploy aws-organizational-unit/plat -s core-gbl-root
81128
82129 deploy/accounts :
130+ env :
131+ ATMOS_PROFILE : superadmin
83132 description : Deploys all AWS Organization accounts
84133 steps :
85134 - command : terraform deploy aws-account/core-artifacts -s core-gbl-root
@@ -93,12 +142,16 @@ workflows:
93142 - command : terraform deploy aws-account/plat-prod -s core-gbl-root
94143
95144 deploy/scps :
145+ env :
146+ ATMOS_PROFILE : superadmin
96147 description : Deploy Service Control Policies
97148 steps :
98149 - command : terraform deploy aws-scp/deny-leaving-organization -s core-gbl-root
99150 - command : terraform deploy aws-scp/deny-creating-users -s core-gbl-root
100151
101152 deploy/aws-account-settings :
153+ env :
154+ ATMOS_PROFILE : superadmin
102155 description : Apply AWS Account settings for best practices.
103156 steps :
104157 - command : terraform deploy aws-account-settings -s core-gbl-artifacts
@@ -113,6 +166,8 @@ workflows:
113166 - command : terraform deploy aws-account-settings -s plat-gbl-staging
114167
115168 deploy/budgets :
169+ env :
170+ ATMOS_PROFILE : superadmin
116171 description : Deploy budgets to all accounts
117172 steps :
118173 - command : terraform deploy aws-budget -s core-gbl-root
@@ -127,12 +182,16 @@ workflows:
127182 - command : terraform deploy aws-budget -s plat-gbl-prod
128183
129184 deploy/cloudtrail :
185+ env :
186+ ATMOS_PROFILE : superadmin
130187 description : Start AWS Cloudtrail in audit and root accounts to track changes across the org.
131188 steps :
132189 - command : terraform deploy cloudtrail-bucket -s core-use1-audit
133190 - command : terraform deploy cloudtrail -s core-gbl-root
134191
135192 deploy/ecr :
193+ env :
194+ ATMOS_PROFILE : superadmin
136195 description : Deploy ECR in the artifacts account to use as our container registry
137196 steps :
138197 - command : terraform deploy ecr -s core-use1-artifacts
0 commit comments