-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR corrects many broken hash links
- Loading branch information
Showing
16 changed files
with
124 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,29 +291,29 @@ The example code above does the following: | |
1. **Create 6 child AWS accounts**. These accounts are described in more detail in the [How to configure a production-grade AWS account structure using Gruntwork AWS Landing Zone child accounts section](https://www.gruntwork.io/guides/foundations/how-to-configure-production-grade-aws-account-structure/#child_accounts). | ||
|
||
2. **Associate an email address with each of the child accounts**. This will be the email address for the root user of | ||
each account and AWS requires that the root user’s email address is _globally_ unique, so it cannot be the email | ||
address you used for the root account or any of the other child accounts. You’ll have to either create multiple email | ||
accounts in your company’s email system, or, if your company uses Gmail (perhaps as part of G Suite), you can take | ||
advantage of the fact that [Gmail | ||
ignores everything after a plus sign in an email address](https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html), so that while AWS will see | ||
`[email protected]`, `[email protected]`, and | ||
`[email protected]` as three unique email addresses, Gmail will see them all as the same email | ||
address, `[email protected]`. | ||
each account and AWS requires that the root user’s email address is _globally_ unique, so it cannot be the email | ||
address you used for the root account or any of the other child accounts. You’ll have to either create multiple email | ||
accounts in your company’s email system, or, if your company uses Gmail (perhaps as part of G Suite), you can take | ||
advantage of the fact that [Gmail | ||
ignores everything after a plus sign in an email address](https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html), so that while AWS will see | ||
`[email protected]`, `[email protected]`, and | ||
`[email protected]` as three unique email addresses, Gmail will see them all as the same email | ||
address, `[email protected]`. | ||
|
||
3. **Mark one of the child accounts as a logs account**. We set `is_logs_account = true` on one of the child accounts | ||
to indicate it is the logs account where we will aggregate AWS Config, CloudTrail, IAM Access Analyzer, Security Hub and Amazon Macie data from all the other accounts. | ||
The `account-baseline-root` module will automatically create an S3 bucket for AWS Config and an S3 bucket and KMS CMK | ||
= for CloudTrail in this account and configure the root account to send all the AWS Config and CloudTrail data to these | ||
S3 buckets. Later on, you’ll configure all the other accounts to send their data to these S3 buckets too. | ||
to indicate it is the logs account where we will aggregate AWS Config, CloudTrail, IAM Access Analyzer, Security Hub and Amazon Macie data from all the other accounts. | ||
The `account-baseline-root` module will automatically create an S3 bucket for AWS Config and an S3 bucket and KMS CMK | ||
= for CloudTrail in this account and configure the root account to send all the AWS Config and CloudTrail data to these | ||
S3 buckets. Later on, you’ll configure all the other accounts to send their data to these S3 buckets too. | ||
|
||
4. **Create IAM groups**. By default, `account-baseline-root` will **not** create a `full-access` IAM group as CIS requirement 1.16 guides. It will create a `support` and a `billing` IAM group (for the support and finance teams). | ||
|
||
5. **Create IAM users**. For this example, we create `alice` and `bob`, adding `alice` to the `full-access` | ||
IAM group and `bob` to the `billing` IAM group. _Note_: your own IAM user (the one you created manually) should be | ||
in the `users` list; we’ll use the `import` command to put this user under Terraform management shortly. | ||
IAM group and `bob` to the `billing` IAM group. _Note_: your own IAM user (the one you created manually) should be | ||
in the `users` list; we’ll use the `import` command to put this user under Terraform management shortly. | ||
|
||
6. **Generate a password for each user**. We encrypt this password with that user’s PGP key from Keybase (we’ll come | ||
back to how to handle the passwords shortly). | ||
back to how to handle the passwords shortly). | ||
|
||
Pull in the [backend](https://www.terraform.io/docs/backends/) settings from a root `terragrunt.hcl` file that you | ||
`include` in each child `terragrunt.hcl`: | ||
|
@@ -581,6 +581,6 @@ Use this process to reset the password for the root user of each child account y | |
|
||
## Lock down the root user in the child accounts | ||
|
||
Once you’re able to access the root user of each child account, you should follow the steps in [Lock down the root user](#lock_down_root_user) | ||
Once you’re able to access the root user of each child account, you should follow the steps in [Lock down the root user](../4-lock-down-the-root-user.md) | ||
for each of those child accounts—including enabling MFA and deleting the root user’s access keys—and (almost) never use | ||
those root users again. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 15 additions & 14 deletions
29
_docs-sources/guides/reference-architecture/07-undeploy/09-useful-tips.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
# Useful tips | ||
|
||
- **Destroy resources in groups instead of all at once.** | ||
- There are [known instabilities](#known-errors) with destroying many modules at once. In addition, Terragrunt is | ||
designed to process the modules in a graph, and will not continue on if there is an error. This means that you | ||
could run into situations where Terragrunt has destroyed a module, but returns an error due to Terraform bugs that | ||
prevent you from cleanly calling destroy twice. | ||
|
||
- There are [known instabilities](10-known-errors.md) with destroying many modules at once. In addition, Terragrunt is | ||
designed to process the modules in a graph, and will not continue on if there is an error. This means that you | ||
could run into situations where Terragrunt has destroyed a module, but returns an error due to Terraform bugs that | ||
prevent you from cleanly calling destroy twice. | ||
- To address these instabilities, it is recommended to destroy the resources in groups. For example, you can start | ||
by destroying all the services first (e.g., `stage/REGION/stage/services`), then the data stores (e.g., | ||
`stage/REGION/stage/data-stores`), and finally the networking resources (e.g., `stage/REGION/stage/networking`). | ||
by destroying all the services first (e.g., `stage/REGION/stage/services`), then the data stores (e.g., | ||
`stage/REGION/stage/data-stores`), and finally the networking resources (e.g., `stage/REGION/stage/networking`). | ||
- When identifying groups to destroy, use [terragrunt | ||
graph-dependencies](https://terragrunt.gruntwork.io/docs/reference/cli-options/#graph-dependencies) to view the | ||
dependency graph so that you destroy the modules in the right order. | ||
graph-dependencies](https://terragrunt.gruntwork.io/docs/reference/cli-options/#graph-dependencies) to view the | ||
dependency graph so that you destroy the modules in the right order. | ||
|
||
- **Empty + Delete S3 buckets using the web console (when destroying whole environments).** | ||
- As mentioned in [Pre-requisite: force_destroy on S3 buckets](#pre-requisite-force_destroy-on-s3-buckets), it is | ||
recommended to set `force_destroy = true` prior to running destroy so that terraform can destroy the S3 buckets. | ||
However, this can be cumbersome if you are destroying whole environments, as it can be difficult to flip the bit in | ||
every single module. | ||
- As mentioned in [Pre-requisite: force_destroy on S3 buckets](03-pre-requisite-force-destroy-on-s3-buckets.md), it is | ||
recommended to set `force_destroy = true` prior to running destroy so that terraform can destroy the S3 buckets. | ||
However, this can be cumbersome if you are destroying whole environments, as it can be difficult to flip the bit in | ||
every single module. | ||
- Instead, oftentimes it is faster and more convenient to first empty and then delete the buckets using the AWS web console prior to | ||
invoking `destroy` with `terragrunt`. | ||
invoking `destroy` with `terragrunt`. | ||
- **IMPORTANT**: You should only do this if you are intending on destroying an entire environment. Otherwise, it is | ||
too easy to accidentally delete the wrong S3 bucket. | ||
too easy to accidentally delete the wrong S3 bucket. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.