|
1 | 1 | # Module Architecture |
2 | 2 |
|
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). |
4 | 4 |
|
5 | | - |
| 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. |
6 | 6 |
|
7 | | -## Deployment to member accounts |
| 7 | + |
8 | 8 |
|
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: |
10 | 10 |
|
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. |
12 | 20 |
|
13 | | - |
| 21 | +## Resources in workload accounts |
14 | 22 |
|
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. |
16 | 24 |
|
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. |
21 | 26 |
|
22 | | -## Central account resources per deployment |
| 27 | + |
23 | 28 |
|
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. |
33 | 36 |
|
34 | | -## Member account resources |
| 37 | +Within each workload account, for each deployment, the following resources are created: |
35 | 38 |
|
36 | 39 | - Backup Vault |
37 | 40 | - Restore Vault |
|
0 commit comments