Skip to content

Commit d1b366c

Browse files
committed
WIP docs
1 parent 66193be commit d1b366c

File tree

6 files changed

+115
-29
lines changed

6 files changed

+115
-29
lines changed

docs/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Module Architecture
22

3-
The module is designed to be deployed in a dedicated account within an AWS Organization, this account [must be delegated certain abilities for the module to function](usage.md).
3+
The module is designed to be deployed in a dedicated account within an AWS Organization, this account [must be delegated certain abilities for the module to function](usage-prerequisites.md).
44

55
![An AWS architecture diagram showing the module architecture. There are 2 AWS accounts, the Backup delegate account and the Workload accounts (of which there could be multiple). In the Backup delegate account are 3 Backup Vaults - LAG Vault, Intermediate Standard Vault, and Standard Vault - there is also an EventBridge Event Bus. In the Workload account are resources to be backed up, these have an arrow directing backups in a Standard Vault within this account. From the Workload account's Standard Vault an arrow goes to the LAG and Intermediate Standard Vaults in the other account. The Intermediate Standard Vault then has an arrow to the Standard Vault in the Backup delegate account with a Step Function over it. An Event Bridge rule for Backup events in the Workload account forwards these to the Event Bus in the Backup delegate account.](assets/images/backup-architecture.png)
66

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Backing up your resources
2+
3+
This document provides guidance on how to back up resources using this Terraform module. It will not repeat the [documentation provided by AWS Backup](https://docs.aws.amazon.com/aws-backup/latest/devguide/creating-a-backup.html), but will instead focus on the specific requirements and configurations needed for this module to work effectively.
4+
5+
## DynamoDB
6+
7+
[AWS Backup advanced features for DynamoDB](https://docs.aws.amazon.com/aws-backup/latest/devguide/advanced-ddb-backup.html) must be enabled within the workload account.
8+
9+
## KMS Encryption of resources
10+
11+
### AWS Managed KMS Keys
12+
13+
Backups of resource types that are not "fully managed" by AWS Backup within the workload accounts will retain the encryption configuration of the source resource. Backups of resources that are encrypted with an AWS managed KMS Key - a key with an alias starting `aws/` - [cannot be copied cross-account](https://docs.aws.amazon.com/aws-backup/latest/devguide/encryption.html#copy-encryption).
14+
15+
### Customer Managed KMS Keys
16+
17+
Backups of resource types that are not "fully managed" by AWS Backup within the workload accounts will retain the encryption configuration of the source resource. Where the source resource is encrypted with a customer managed KMS Key, the Key Policy needs to allow the principals used by AWS Backup to use the key for cross-account copying; this still applies when the default KMS Key Policy is used.
18+
19+
Ensure that the statements below are included within the Key Policy of the customer managed KMS Key used to encrypt the source resources, these have been derived from [AWS Guidelines](https://repost.aws/knowledge-center/backup-troubleshoot-cross-account-copy).
20+
21+
```json
22+
{
23+
"Version": "2012-10-17",
24+
"Statement": [
25+
...
26+
{
27+
"Sid": "Allow AWS Backup to use the key for backup and cross-account copy",
28+
"Effect": "Allow",
29+
"Principal": {
30+
"AWS": [
31+
"arn:aws:iam::${WorkloadAccountID}:role/${DeploymentBackupServiceRoleName}",
32+
"arn:aws:iam::${CentralAccountID}:role/aws-service-role/backup.amazonaws.com/AWSServiceRoleForBackup"
33+
]
34+
},
35+
"Action": [
36+
"kms:DescribeKey",
37+
"kms:Encrypt",
38+
"kms:Decrypt",
39+
"kms:ReEncrypt*",
40+
"kms:GenerateDataKey",
41+
"kms:GenerateDataKeyWithoutPlaintext"
42+
],
43+
"Resource": "*"
44+
},
45+
{
46+
"Sid": "Allow AWS Backup to manage grants for backup and cross-account copy",
47+
"Effect": "Allow",
48+
"Principal": {
49+
"AWS": [
50+
"arn:aws:iam::${WorkloadAccountID}:role/${DeploymentBackupServiceRoleName}",
51+
"arn:aws:iam::${CentralAccountID}:role/aws-service-role/backup.amazonaws.com/AWSServiceRoleForBackup"
52+
]
53+
},
54+
"Action": [
55+
"kms:CreateGrant",
56+
"kms:ListGrants",
57+
"kms:RevokeGrant"
58+
],
59+
"Resource": "*",
60+
"Condition": {
61+
"Bool": {
62+
"kms:GrantIsForAWSResource": "true"
63+
}
64+
}
65+
}
66+
]
67+
}
68+
```
69+
70+
## S3
71+
72+
S3 is "fully managed" by AWS Backup, so the source encryption does not matter as long as the Backup Service Role can access the objects.
73+
74+
When `create_continuous_backups` or `snapshot_from_continuous_backups` is enabled on a plan targetting the bucket, a continuous backup will be created in the workload account Backup Vault. Snapshots will then be taken from the continuous backup and copied to the central account Backup Vault, in line with [AWS best practice](https://docs.aws.amazon.com/aws-backup/latest/devguide/s3-backups.html#bestpractices-costoptimization).
75+
76+
To ensure your objects are backed up, see the [prerequisites from AWS](https://docs.aws.amazon.com/aws-backup/latest/devguide/s3-backups.html#s3-backup-prerequisites).

docs/usage.md renamed to docs/usage-configuration.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
1-
# Using the module
1+
# Configuration
22

3-
## Prerequisites
3+
The module is designed to be deployed only once per Organization, it can be deployed multiple times as long as [`central_account_resource_name_prefix`](#inputs_central_account_resource_name_prefix) is unique to each module call. Within the configuration of the module you can define multiple deployments to target areas of your organization with tailored backup plans.
44

5-
**It is strongly recommended that this module is deployed into a dedicated AWS Backup account within your AWS Organization.**
5+
## Inputs
66

7-
The module is designed to be deployed into a delegated administrator account within an AWS Organization, it assumes that these requirements are met when deploying:
8-
9-
- [All features are enabled](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) for your AWS Organization.
10-
- [Trusted access with AWS Backup](https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-backup.html#integrate-enable-ta-backup) is enabled on your Organization.
11-
- [Backup Policies](https://docs.aws.amazon.com/organizations/latest/userguide/enable-policy-type.html) within your Organization.
12-
- [Enable cross-account backup](https://docs.aws.amazon.com/aws-backup/latest/devguide/create-cross-account-backup.html#prereq-cab) is turned on within your Organization.
13-
- [AWS Backup cross-account monitoring](https://docs.aws.amazon.com/aws-backup/latest/devguide/manage-cross-account.html#enable-cross-account) is enabled within your Organization.
14-
- Resource Access Manager (RAM) sharing with AWS Organizations enabled in management account at Resource Access Manager, Settings
15-
- The account you are deploying to has been [delegated to manage AWS Backup](https://docs.aws.amazon.com/aws-backup/latest/devguide/manage-cross-account.html#backup-delegatedadmin).
16-
- The account you are deploying to has been [delegated to manage CloudFormation StackSets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html).
17-
- The account you are deploying to has permission to [manage Backup Policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_delegate_policies.html) as detailed in [our example delegation policy](./org-policy.md).
18-
19-
## Deployment & Configuration
20-
21-
The module is to be deployed only once per Organization, within the configuration for the module you can define multiple deployments with unique settings.
7+
<!-- prettier-ignore-start -->
8+
| Name | Description | Type | Default | Required |
9+
|------|-------------|------|---------|----------|
10+
| <a name="inputs_central_account_resource_name_prefix"></a> [central\_account\_resource\_name\_prefix](#inputs\_central\_account\_resource\_name\_prefix) | Prefix to be used for resource names in the central account. | `string` | | yes |
11+
| <a name="inputs_deployments"></a> [deployments](#inputs\_deployments) | A map of deployments, see [Deployments](#deployments) | `map(object)` | | you |
12+
| <a name="inputs_member_account_resource_name_prefix"></a> [member\_account\_resource\_name\_prefix](#inputs\_member\_account\_resource\_name\_prefix) | Prefix to be used for resource names in member accounts. | `string` | | yes |
13+
| <a name="inputs_terraform_state_bucket_name"></a> [terraform\_state\_bucket\_name](#inputs\_terraform\_state\_bucket\_name) | Name of the S3 bucket used for storing Terraform state files for resources within workload accounts. | `string` | | yes |
14+
<!-- prettier-ignore-end -->
2215

2316
### Deployments
2417

2518
A deployment is an instance of the backup solution. Within the deployment account it creates a single set of resources (Backup Vaults, KMS Key, CloudFormation StackSet, etc.) that can then be used by multiple workload accounts. Deployments create a **security boundary** for your backups. The key value for each deployment is used to generate unique resource names within the deployment account and workload accounts.
2619

27-
### Variables
28-
2920
<!-- prettier-ignore-start -->
3021
| Name | Description | Type | Default | Required |
3122
|------|-------------|------|---------|----------|

docs/org-policy.md renamed to docs/usage-prerequisites.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1-
# Organization Delegation Policy
1+
# Prerequisites
22

3-
The account to which you are deploying this module requires permission to [manage Backup Policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_delegate_policies.html) through your Organization's delegation policy.
3+
**It is strongly recommended that this module is deployed into a dedicated AWS Backup account within your AWS Organization.**
44

5-
An example delegation policy is provided below, derived from [AWS guidelines](https://aws.amazon.com/blogs/storage/delegated-administrator-support-for-aws-backup).
5+
The module is designed to be deployed into a delegated administrator account within an AWS Organization, it assumes that these requirements are met when deploying:
6+
7+
- [All features are enabled](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) for your AWS Organization.
8+
- [Trusted access with AWS Backup](https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-backup.html#integrate-enable-ta-backup) is enabled on your Organization.
9+
- [Backup Policies](https://docs.aws.amazon.com/organizations/latest/userguide/enable-policy-type.html) are enabled within your Organization.
10+
- [Enable cross-account backup](https://docs.aws.amazon.com/aws-backup/latest/devguide/create-cross-account-backup.html#prereq-cab) is turned on within your Organization.
11+
- [AWS Backup cross-account monitoring](https://docs.aws.amazon.com/aws-backup/latest/devguide/manage-cross-account.html#enable-cross-account) is enabled within your Organization.
12+
- Resource Access Manager (RAM) sharing with AWS Organizations enabled in management account at Resource Access Manager, Settings
13+
- The account you are deploying to has been [delegated to manage AWS Backup](https://docs.aws.amazon.com/aws-backup/latest/devguide/manage-cross-account.html#backup-delegatedadmin).
14+
- The account you are deploying to has been [delegated to manage CloudFormation StackSets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html).
15+
- The account you are deploying to has permission to [manage Backup Policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_delegate_policies.html) as detailed in [our example resource-based delegation policy](#Example-organization-resource-based-delegation-policy).
16+
17+
## Example organization resource-based delegation policy
18+
19+
The account to which you are deploying this module requires permission to [manage Backup Policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_delegate_policies.html) through your Organization's resource-based delegation policy.
20+
21+
An example resource-based delegation policy is provided below, derived from [AWS guidelines](https://aws.amazon.com/blogs/storage/delegated-administrator-support-for-aws-backup).
622

723
- In the console for your AWS management account, navigate to AWS Organizations -> Settings -> Delegated administrator for AWS Organizations -> Delegate
824

@@ -18,6 +34,7 @@ An example delegation policy is provided below, derived from [AWS guidelines](ht
1834

1935
- replace `${root_id}` with your Organization Root ID
2036

37+
<!-- prettier-ignore-start -->
2138
```json
2239
{
2340
"Version": "2012-10-17",
@@ -93,4 +110,5 @@ An example delegation policy is provided below, derived from [AWS guidelines](ht
93110
}
94111
]
95112
}
96-
```
113+
```
114+
<!-- prettier-ignore-end -->

mkdocs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ nav:
4646
- Home: index.md
4747
- Why use this module?: why-use-this-module.md
4848
- Architecture: architecture.md
49-
- Usage:
50-
- Using the module: usage.md
51-
- Organizations policy: org-policy.md
49+
- Using the module:
50+
- Prerequisites: usage-prerequisites.md
51+
- Configuration: usage-configuration.md
52+
- Backing up your resources: usage-backing-up-your-resources.md
5253

5354
plugins:
5455
- social

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ variable "member_account_resource_name_prefix" {
4646

4747
variable "terraform_state_bucket_name" {
4848
type = string
49-
description = "Name of S3 bucket for custom Terraform deployments, if left at default, S3 bucket will be created"
49+
description = "Name of the S3 bucket used for storing Terraform state files for resources in workload accounts. If not specified, an S3 bucket will be created in the central account."
5050
default = ""
5151
}

0 commit comments

Comments
 (0)