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
{{ message }}
This repository was archived by the owner on Oct 7, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+40-45Lines changed: 40 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -1,73 +1,73 @@
1
-
# reference-architectures
1
+
# Reference Architectures
2
2
3
3
Get up and running quickly with one of our reference architectures using our fully automated cold-start process.
4
4
5
5
**NOTE:** This project is under active development and subject to change. Please [file issues](https://github.com/cloudposse/reference-architectures/issues/new) for all bugs encountered.
-**AWS does not support programmatic deletion of accounts.** This means that if you use this project to create the account structure, terraform is not able to completely destroy it.
26
-
-**AWS by default only permits one subaccount.** This limit can be easily increased for your organization, but can take up to several days.
27
-
-**AWS will rate limit account creation.** This might mean you'll need to restart the provisioning (just re-run `make root`).
25
+
-**AWS does not support programmatic deletion of accounts.** This means that if you use this project to create the account structure, but terraform is not able to completely tear it down. Deleting AWS accounts is a long, painful process, because AWS does not want to be on the hook for deleting stuff that it cannot get back.
26
+
-**AWS by default only permits one sub-account.** This limit can be easily increased for your organization but can take up to several days.
27
+
-**AWS will rate limit account creation.** This might mean you'll need to restart the provisioning.
28
+
-**AWS only supports creating member accounts from the master account.** This means you cannot create accounts from within child/member accounts.
29
+
-**AWS does not permit email addresses to be reused across accounts.** One key thing is that the email address associated with the account will be forever associated with that account. You will not be able to create a new account with that email address and you will not be able to change the email address later. So before you delete an account, change the email address to something you can consider a throwaway. Gmail and some other providers allow you to use plus-addressing (e.g. `[email protected]`)" to your username to create a unique email that still routes to you, so we suggest you use plus addressing for your accounts.
28
30
29
-
## HighLevel Overview
31
+
## High-Level Overview
30
32
31
33
You can provision the basic reference architecture in 3 "easy" steps. =)
32
34
33
-
All accounts will leverage our [`terraform-root-modules`](https://github.com/cloudposse/terraform-root-modules/) service catalog to get you started. Later, we recommend you fork this and start your own service catalog suitable for your organization.
35
+
All accounts will leverage our [`terraform-root-modules`](https://github.com/cloudposse/terraform-root-modules/) service catalog to get you started. Later, we recommend you fork this and start your very own service catalog suitable for your organization.
34
36
35
37
This process involves using `terraform` to generate the code (`Dockerfile`, `Makefile`, `terraform.tfvar`, etc) that you will use to manage your infrastructure.
36
38
37
-
This is a "bootstrap" process that gets you running from a cold-start. You do it once and then you literally throw _this_ (e.g. `reference-architectures/`) repo away. This project generates all the pre-configured boilerplate scaffolding you need in the `repos/` directory.
38
-
39
-
When you're done, in the `repos/` directory you'll have one Git repo for each AWS account. These repos are what you'll want to push up to GitHub. Each repo contains everything necessary to administer that account. We practice a strict "share nothing" approach, which is why each account gets it's own repo, terraform state backend, and DNS zone. This maximally reduces the blast radius of any human errors in one account affecting any other account. Also, because each account has it's own repo, it's _ideally_ suited for larger enterprise or corporate environments where various stakeholders will be responsible for running services in their account.
39
+
This repo contains everything necessary to administer this architecture. We strive for a "share nothing" approach, which is why we use multiple AWS accounts and DNS zones. This reduces the blast radius from human errors. This reference architecture is _ideally_ suited for larger enterprise or corporate environments where various stakeholders will be responsible for running services in their account.
40
40
41
41
See the [Next Steps](#next-steps) section for where to go after this process completes.
42
42
43
43
### Architecture
44
44
45
45
Our "reference architecture" is an opinionated approach to architecting accounts for AWS.
46
46
47
-
This process provisions (7) accounts which have different designations.
47
+
This process provisions 7+ accounts that have different designations.
48
48
49
49
Here is what it includes. Enable the accounts you want.
|master| The "master" (parent, billing) account creates all child accounts and is where users login. |
54
+
| prod | The "production" is account where you run your most mission critical applications |
55
+
| staging | The "staging" account is where you run all of your QA/UAT/Testing |
56
+
| dev | The "dev" sandbox account is where you let your developers have fun and break things |
57
+
| audit | The "audit" account is where all logs end up |
58
+
| corp | The "corp" account is where you run the shared platform services for the company |
59
+
| data | The "data" account is where the quants live =) |
60
+
| testing | The "testing" account is where to run automated tests of unblessed infrastructure code|
61
+
| security | The "security" account is where to run automated security scanning software |
62
+
| identity | The "identity" account is where to add users and delegate access to the other accounts |
63
63
64
64
Each account has its own [terraform state backend](https://github.com/cloudposse/terraform-aws-tfstate-backend), along with a [dedicated DNS zone](https://www.terraform.io/docs/providers/aws/r/route53_zone.html) for service discovery.
65
65
66
-
The root account owns the top-level DNS zone and then delegates NS authority to each child account.
66
+
The master account owns the top-level DNS zone and then delegates NS authority to each child account.
67
67
68
68
### Assumptions
69
69
70
-
1. We are starting with a clean AWS environment and a new "root" (top-level) AWS account. This means you need the "root" credentials, since a fresh AWS account doesn't even have any AWS roles that can be assumed.
70
+
1. We are starting with a clean AWS environment and a new "master" (top-level) AWS account. This means you need the "master" credentials, since a fresh AWS account doesn't even have any AWS roles that can be assumed.
71
71
2. You have administrator access to this account.
72
72
3. You have [docker](https://docs.cloudposse.com/tools/docker/) installed on your workstation.
73
73
4. You have [terraform](https://www.terraform.io/downloads.html) installed on your workstation.
@@ -81,22 +81,19 @@ Before we get started, make sure you have the following
81
81
-[ ] Clone this repo on your workstation.
82
82
-[ ] Create a _temporary_ pair of [Access Keys](https://console.aws.amazon.com/iam/home#/security_credential). These should be deleted afterwards.
83
83
-[ ] Export your AWS "root" account credentials as `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` (this is _temporary_ for bootstrapping).
84
-
-[ ] An available domain we can use for DNS-base service discovery (E.g. `ourcompany.co`). This domain must not be in use elsewhere as the root account will need to be the authoritative name server (`SOA`).
85
-
-[ ] Ensure that any users who will be added during this bootstrap process have created their [keybase](http://keybase.io) profile, and have an associated GPG key. You'll need this if setting them up in the `users` section of the [`config/root.tfvars`](https://github.com/cloudposse/reference-architectures/blob/master/configs/root.tfvars). For example you should be able to [verify each user's public key](https://keybase.io/osterman/key.asc) on `keybase.io` by running `curl https://keybase.io/$username/key.asc`.
84
+
-[ ] An available domain we can use for DNS-base service discovery (E.g. `ourcompany.co`). This domain must not be in use elsewhere as the master account will need to be the authoritative name server (`SOA`).
86
85
87
86
## Get Started
88
87
89
-
### 1. Provision Root Account
90
-
91
-
The "root" account is the top-most AWS account from which all other AWS accounts are programmatically created.
88
+
### 1. Provision Master Account
92
89
93
-
**WARNING:** Terraform cannot remove an AWS account from an organization. Terraform **cannot** close the account. The child account must be prepared to be a standalone account beforehand. To do this, issue a password reset using the child account's email address. Login and accept the prompts. Then you should be good to go. See the [AWS Organizations documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html) for more information.
90
+
The "master" account is the top-most AWS account from which all other AWS accounts are programmatically created.
94
91
95
-
**WARNING:**Do not chain the `make` targets together (e.g. `make root children finalize`) as it is not currently supported.
92
+
**WARNING:**Terraform cannot remove an AWS account from an organization. Terraform **cannot** close the account. The child account must be prepared to be a standalone account beforehand. To do this, issue a password reset using the child account's email address. Login and accept the prompts. Then you should be good to go. See the [AWS Organization documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html) for more information.
96
93
97
-
This account is provisioned slightly different from the other subaccounts.
94
+
This account is provisioned slightly differently from the other member accounts.
98
95
99
-
Update the configuration for this account by editing the `configs/root.tfvar` file.
96
+
Update the configuration for this account by editing the `configs/master.tfvar` file.
100
97
101
98
Then to get started, run:
102
99
@@ -105,7 +102,7 @@ make root
105
102
```
106
103
107
104
**NOTE:** We need to know each account's `AWS_ACCOUNT_ID` for Step 2.
108
-
**NOTE:** Sometimes provisioning of the `account` module fails due to rate limiting by AWS on creating subaccounts. If this happens, just run `make root/provision` to retry. If that works, just continue on to step 2, once it completes.
105
+
**NOTE:** Sometimes provisioning of the `account` module fails due to rate limiting by AWS on creating sub-accounts. If this happens, just run `make root/provision` to retry. If that works, just continue on with step 2, once it completes.
109
106
110
107
<details>
111
108
<summary>Here's what that roughly looks like (but entirely automated). </summary>
@@ -121,7 +118,7 @@ make root
121
118
122
119
### 2. Provision Subaccounts
123
120
124
-
Subaccounts are created by the root account, but are ultimately provisioned using the subaccount containers.
121
+
Subaccounts are created by the master account, but are ultimately provisioned using the subaccount containers.
125
122
126
123
Update the configuration for all the child accounts by editing the `configs/$stage.tfvar` file (replace `$stage` with the name of the account).
127
124
@@ -158,8 +155,8 @@ make finalize
158
155
<summary>Here's what that roughly looks like (but entirely automated).</summary>
159
156
160
157
1. Re-use the docker images from phase (1) and phase (2).
161
-
2. Update DNS so that root account delegates DNS zones to the child accounts.
162
-
3. Enable cloudtrail log forwarding to audit account.
158
+
2. Update DNS so that `master` account delegates DNS zones to the child accounts.
159
+
3. Enable cloudtrail log forwarding to `audit` account.
163
160
164
161
</details>
165
162
@@ -171,17 +168,15 @@ At this point, you have everything you need to start terraforming your way to su
171
168
172
169
All of your account configurations are currently in `repos/`
173
170
174
-
-[ ] Commit the changes in `repos/`. Open Pull Requests.
171
+
-[ ] Commit all the changes made. Open Pull Requests.
175
172
-[ ] Ensure that the name servers for the service discovery domain (e.g. `ourcompany.co`) have been configured with your domain registrar (e.g. GoDaddy).
176
-
-[ ] Delete your root account credentials. They are no longer needed and should not be used. Instead use the created IAM users.
173
+
-[ ] Delete your master account credentials. They are no longer needed and should not be used. Instead, use the created IAM users.
177
174
-[ ] Request limits for EC2 instances to be raised in each account corresponding to the region you will be operating in.
178
175
-[ ] Set the child account's credentials. To do this, issue a password reset using the child account's email address. Login and accept the prompts. Setup MFA.
179
-
-[ ] Ensure you have MFA setup on your root account.
176
+
-[ ] Ensure you have MFA setup on your master account.
180
177
-[ ] Consider adding some other capabilities from our service catalog.
181
178
-[ ] Create your own [`terraform-root-modules`](https://github.com/cloudposse/terraform-root-modules) service catalog for your organization.
182
179
183
-
**NOTE:**_This_ repo can be deleted once you're all done and pushed your changes in the `repos/` directory to GitHub. The rest of your development should happen inside your infrastructure repos.
184
-
185
180
## Getting Help
186
181
187
182
Did you get stuck? Find us on [slack](https://sweetops.cloudposse.com) in the `#geodesic` channel.
0 commit comments