This module creates an AWS Organization Backup Policy consisting of one or more backup plans to be deployed to accounts within the specified Organizational Unit.
The following example creates a generalised backup policy targeting all compatible AWS Backup resources. Resources are matched
if they have a tag with the key BackupPolicy
and a value matching the plan name - in this case daily
. This policy is
applied to all accounts within the specified organizational unit and is run on a daily schedule starting at 3am.
module "basic" {
source = "appvia/backup/aws"
version = "1.0.0"
name = "general-backup"
organizational_unit = "ou-1tbg-wpzfzxb7"
plans = [{
name = "daily"
schedule = "cron(0 3 ? * * *)"
start_window_minutes = "60"
complete_window_minutes = "300"
}]
}
resource "aws_s3_bucket" "data_pending_processing" {
bucket = "io-appvia-data-pending-processing"
tags = {
BackupPolicy = "daily"
}
}
The terraform-docs
utility is used to generate this README. Follow the below steps to update:
- Make changes to the
.terraform-docs.yml
file - Fetch the
terraform-docs
binary (https://terraform-docs.io/user-guide/installation/) - Run
terraform-docs markdown table --output-file ${PWD}/README.md --output-mode inject .
Name | Version |
---|---|
terraform | >= 1.7 |
aws | >= 5 |
Name | Version |
---|---|
aws | >= 5 |
No modules.
Name | Type |
---|---|
aws_cloudformation_stack_set.role | resource |
aws_cloudformation_stack_set.vault | resource |
aws_cloudformation_stack_set_instance.role | resource |
aws_cloudformation_stack_set_instance.vault | resource |
aws_organizations_policy.backup | resource |
aws_organizations_policy_attachment.backup | resource |
aws_region.current | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
name | Name of the backup policy | string |
n/a | yes |
plans | List of plan definitions. Each definition defines a backup plan governing the frequency, destinations and retention settings. | list(object({ |
n/a | yes |
deployment_targets | The accounts or organizational unit to attach the backup policy to. | list(string) |
[] |
no |
regions | List of regions where resources to be backed up are located | list(string) |
[] |
no |
tags | Map of tags to apply to resources create by this module. These are also passed down to individual backups. | map(string) |
{} |
no |
vaults | List of Backup Vaults to be created along with their lock configuration | list(object({ |
[] |
no |
No outputs.