Skip to content

Commit bf9e700

Browse files
authored
Update documentation (#70)
1 parent 66193be commit bf9e700

12 files changed

+258
-173
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
An open-source Terraform module to deploy and orchestrate AWS Backup for creating fully immutable backups within an AWS Organization.
44

55
- Manages the deployment of Backup Vaults to member accounts using CloudFormation StackSets.
6+
- Allows for targetted deployments to specific Organizations Units (OUs) and prevents cross-talk between deployments.
67
- Stores backups in a central AWS account to protect against account closure or suspension.
7-
- Protection against KMS Key deletion through using AWS Managed and AWS Owned keys.
8-
- Support for Logically Air Gapped Vaults, with logic to use them only for supported resource types.
8+
- Protects against KMS Key deletion through using AWS Managed and AWS Owned keys.
9+
- Supports Logically Air Gapped Vaults, with logic to use them only for supported resource types.
910
- (Optional) Resource selection using tags.
10-
- Implements AWS best practices and guidance for security and cost.
11-
- Simplifies the process of configuring AWS Backup plans.
11+
- Implements AWS best practice and guidance for security and cost.
12+
- Simplifies the process of configuring AWS Backup.
1213

13-
See [Why use this module?](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/why-use-this-module/) in our docs to understand the issues this module solves and how it works.
14+
See [Why use this module?](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/why-use-this-module/) to learn more about the issues this module solves and how it works.
1415

1516
## Architecture and deployment
1617

17-
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](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/usage/). Go to our [Architecture](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/architecture/) documentation for a more detailed explanation of the architecture and how the module works.
18+
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](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/usage/). See our [Architecture](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/architecture/) documentation for a detailed explanation of the architecture and how the module works.
1819

19-
![Architecture Diagram](https://raw.githubusercontent.com/nationalarchives/terraform-aws-immutable-aws-backup/refs/heads/main/docs/assets/images/backup-architecture.png)
20+
![Architecture Diagram](https://raw.githubusercontent.com/nationalarchives/terraform-aws-immutable-aws-backup/refs/heads/main/docs/assets/images/backup-deployment-architecture.png)
2021

2122
## Example Usage
2223

@@ -27,11 +28,10 @@ module "immutable_aws_backup" {
2728
2829
central_account_resource_name_prefix = "immutable-aws-backup-"
2930
member_account_resource_name_prefix = "orgdeploy-immutable-aws-backup-"
30-
terraform_state_bucket_name = "my-terraform-state-bucket"
3131
3232
deployments = {
3333
"website-service" = {
34-
backup_targets = ["ou-abcd-defghijk"]
34+
targets = ["ou-abcd-defghijk"]
3535
min_retention_days = 7
3636
max_retention_days = 90
3737
backup_tag_key = "BackupPlan"
@@ -42,17 +42,17 @@ module "immutable_aws_backup" {
4242
rules = [
4343
{
4444
name = "daily",
45-
schedule_expression = "cron(0 3 ? * * *)"
45+
schedule_expression = "cron(0 3 ? * * *)" # Every day at 3am UTC
4646
delete_after_days = 7
4747
},
4848
{
4949
name = "weekly",
50-
schedule_expression = "cron(0 3 ? * 2 *)"
50+
schedule_expression = "cron(0 3 ? * 2 *)" # Every Monday at 3am UTC
5151
delete_after_days = 28
5252
},
5353
{
5454
name = "monthly",
55-
schedule_expression = "cron(0 3 1 * ? *)"
55+
schedule_expression = "cron(0 3 1 * ? *)" # Every 1st of the month at 3am UTC
5656
delete_after_days = 90
5757
}
5858
]

docs/architecture.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
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

5-
![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)
5+
One call of this module can deploy multiple instances of AWS Backup, each with a different configuration and to different Organizational Units; we call each of these a "deployment". Deployments act as a **security boundary** between instances; accounts targetted by one deployment cannot influence the backups of another deployment. The diagram below shows the architecture of a single deployment.
66

7-
## Deployment to member accounts
7+
![An AWS architecture diagram showing the architecture of a deployment. 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-deployment-architecture.png)
88

9-
Deployment to member accounts is orchestrated through [CloudFormation StackSets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html). The module uses CloudFormation as it enables deployment to many AWS accounts without the need to configure and manage a Terraform provider for each account. StackSets work natively within AWS, reacting when accounts are moved between Organizations and Organizational Units to provision and destroy resources depending on their location within an Organization.
9+
Each deployment orchestrates the creation of resources in both the Backup account and the Workload accounts. Resources created in the Backup account are:
1010

11-
However, as CloudFormation is a declarative syntax for provisioning resources, even more so than Terraform, some of the member account deployment functionality has been implemented through [custom resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) - AWS Lambda calling the AWS API or running Terraform itself. For example, creating the AWS Backup Service-linked IAM Role will only succeed if this role doesn't already exist; by using a custom Lambda function this error can be caught and ignored. Terraform is used to deploy the Backup Vaults within member accounts as it includes a `force_destroy` option that will empty a Vault before deleting it, whereas CloudFormation would fail to delete a Vault with contents.
11+
- 3x Backup Vaults - a Logically Air Gapped (LAG) Vault, an Intermediate Standard Vault, and a Standard Vault.
12+
- An IAM Service Role for AWS Backup.
13+
- An EventBridge Event Bus to receive AWS Backup events from the Workload accounts.
14+
- An EventBridge Rule to forward AWS Backup events from the default bus to the deployment's Event Bus.
15+
- A Step Function to copy backups from the Intermediate Standard Vault to the Standard Vault and update the lifecycle of backups that have been copied.
16+
- A CloudFormation StackSet to deploy resources in the workload accounts.
17+
- A KMS Customer Managed Key to encrypt backups in the Intermediate Vault and workload account vaults.
18+
- A Resource Access Manager (RAM) Share to share the Logically Air Gapped (LAG) Vault with the Workload accounts for recovery.
19+
- A Step Function to manage the copying of backups from the Standard Vault back to workload accounts for recovery.
1220

13-
![An AWS architecture diagram showing how Cloudformation and Lambda are used to deploy resources, has 6 steps. 1. The Organization Management Account delegates the Backup Delegate Account CloudFormation StackSet administration abilities. 2. The Backup Delegate Account creates a StackSet. 3. The StackSet creates Stacks in Workload accounts. 4. Cloudformation within the workload accounts publishes a message to an SNS topic in the Backup Delegate Account. 5. The Deployment Helper Lambda is invoked by SNS. 6. The Deployment Helper Lambda deploys resources into the Workload account.](assets/images/deployment-helper-lambda-architecture.png)
21+
## Resources in workload accounts
1422

15-
## Central account resources
23+
Each deployment orchestrates the creation of resources in workload accounts through [CloudFormation StackSets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html). The module uses CloudFormation as it enables deployment to many AWS accounts without the need to configure and manage a Terraform provider for each account. StackSets work natively within AWS, reacting when accounts are moved between Organizations and Organizational Units to provision and destroy resources depending on their location within an Organization.
1624

17-
- Deployment helper SNS topic
18-
- Deployment helper Lambda function
19-
- AWS Backup Service-linked IAM Role
20-
- S3 Terraform state bucket for deployments to workload accounts
25+
However, as CloudFormation is a declarative syntax for provisioning resources, even more so than Terraform, some of the workload account deployment functionality has been implemented through [custom resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) - an AWS Lambda calling the AWS API or running Terraform itself. For example, creating the AWS Backup Service-linked IAM Role will only succeed if this role doesn't already exist; by using a custom Lambda function this error can be caught and ignored. Terraform is used to deploy the Backup Vaults within workload accounts as it includes a `force_destroy` option that will empty a Vault before deleting it, whereas CloudFormation would fail to delete a Vault with content.
2126

22-
## Central account resources per deployment
27+
![An AWS architecture diagram showing how CloudFormation and Lambda are used to deploy resources, has 6 steps. 1. The Organization Management Account delegates the Backup Delegate Account CloudFormation StackSet administration abilities. 2. Terraform running in the Backup Delegate Account creates a StackSet. 3. The StackSet creates Stacks in workload accounts. 4. Cloudformation within the workload accounts publishes a message to an SNS topic in the Backup Delegate Account. 5. The Deployment Helper Lambda is invoked by SNS. 6. The Deployment Helper Lambda deploys resources into the Workload account.](assets/images/deployment-helper-lambda-architecture.png)
2328

24-
- EventBridge Event Bus
25-
- Backup Ingest Step Function
26-
- Intermediate Backup Vault
27-
- Standard Backup Vault
28-
- LAG Backup Vault
29-
- AWS Backup Service Role
30-
- KMS Customer Managed Key
31-
- CloudFormation StackSet
32-
- Resource Access Manager (RAM) share
29+
The "Deployment Helper" Lambda Function is deployed once in the dedicated Backup account. It is invoked by an SNS topic in the Backup account which recieves messages from CloudFormation stacks within the workload accounts. The Lambda function then deploys resources into the workload accounts. The resources created to support this are:
30+
31+
- An SNS topic to receive messages from CloudFormation stacks in workload accounts.
32+
- An S3 Terraform state bucket, if not passed in as a variable.
33+
- A Lambda function to deploy resources in workload accounts.
34+
- An execution IAM Role for the Lambda Function.
35+
- A CloudWatch Log Group for the Lambda Function.
3336

34-
## Member account resources
37+
Within each workload account, for each deployment, the following resources are created:
3538

3639
- Backup Vault
3740
- Restore Vault
2.18 KB
Loading

docs/index.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
An open-source Terraform module to deploy and orchestrate AWS Backup for creating fully immutable backups within an AWS Organization.
44

55
- Manages the deployment of Backup Vaults to member accounts using CloudFormation StackSets.
6+
- Allows for targetted deployments to specific Organizations Units (OUs) and prevents cross-talk between deployments.
67
- Stores backups in a central AWS account to protect against account closure or suspension.
7-
- Protection against KMS Key deletion through using AWS Managed and AWS Owned keys.
8-
- Support for Logically Air Gapped Vaults, with logic to use them only for supported resource types.
8+
- Protects against KMS Key deletion through using AWS Managed and AWS Owned keys.
9+
- Supports Logically Air Gapped Vaults, with logic to use them only for supported resource types.
910
- (Optional) Resource selection using tags.
10-
- Implements AWS best practices and guidance for security and cost.
11-
- Simplifies the process of configuring AWS Backup plans.
11+
- Implements AWS best practice and guidance for security and cost.
12+
- Simplifies the process of configuring AWS Backup.
1213

13-
See [Why use this module?](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/why-use-this-module/) in our docs to understand the issues this module solves and how it works.
14+
See [Why use this module?](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/why-use-this-module/) to learn more about the issues this module solves and how it works.
1415

1516
## Architecture and deployment
1617

17-
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](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/usage/). Go to our [Architecture](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/architecture/) documentation for a more detailed explanation of the architecture and how the module works.
18+
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](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/usage/). See our [Architecture](https://nationalarchives.github.io/terraform-aws-immutable-aws-backup/architecture/) documentation for a detailed explanation of the architecture and how the module works.
1819

19-
![Architecture Diagram](https://raw.githubusercontent.com/nationalarchives/terraform-aws-immutable-aws-backup/refs/heads/main/docs/assets/images/backup-architecture.png)
20+
![Architecture Diagram](https://raw.githubusercontent.com/nationalarchives/terraform-aws-immutable-aws-backup/refs/heads/main/docs/assets/images/backup-deployment-architecture.png)
2021

2122
## Example Usage
2223

@@ -30,7 +31,7 @@ module "immutable_aws_backup" {
3031
3132
deployments = {
3233
"website-service" = {
33-
backup_targets = ["ou-abcd-defghijk"]
34+
targets = ["ou-abcd-defghijk"]
3435
min_retention_days = 7
3536
max_retention_days = 90
3637
backup_tag_key = "BackupPlan"
@@ -41,17 +42,17 @@ module "immutable_aws_backup" {
4142
rules = [
4243
{
4344
name = "daily",
44-
schedule_expression = "cron(0 3 ? * * *)"
45+
schedule_expression = "cron(0 3 ? * * *)" # Every day at 3am UTC
4546
delete_after_days = 7
4647
},
4748
{
4849
name = "weekly",
49-
schedule_expression = "cron(0 3 ? * 2 *)"
50+
schedule_expression = "cron(0 3 ? * 2 *)" # Every Monday at 3am UTC
5051
delete_after_days = 28
5152
},
5253
{
5354
name = "monthly",
54-
schedule_expression = "cron(0 3 1 * ? *)"
55+
schedule_expression = "cron(0 3 1 * ? *)" # Every 1st of the month at 3am UTC
5556
delete_after_days = 90
5657
}
5758
]

docs/org-policy.md

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)