-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
README.yaml
216 lines (177 loc) · 6.43 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: terraform-aws-backup
# Tags of this project
tags:
- aws
- terraform
- terraform-modules
- efs
- nfs
- terraform-modules
- backup
- backups
- aws-dynamodb
- aws-efs
- efs-backup
- efs-volume
- dynamodb
- dynamodb-backup
- rds
- rds-database
- rds-backup
- ebs
- ebs-backup
- ebs-volumes
# Categories of this project
categories:
- terraform-modules/networking
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Canonical GitHub repo
github_repo: cloudposse/terraform-aws-backup
# Badges to display
badges:
- name: Last Updated
image: https://img.shields.io/github/last-commit/cloudposse/terraform-aws-backup.svg?style=for-the-badge
url: https://github.com/cloudposse/terraform-aws-backup/commits
- name: Latest Release
image: https://img.shields.io/github/release/cloudposse/terraform-aws-backup.svg?style=for-the-badge
url: https://github.com/cloudposse/terraform-aws-backup/releases/latest
- name: Last Updated
image: https://img.shields.io/github/last-commit/cloudposse/terraform-aws-backup.svg?style=for-the-badge
url: https://github.com/cloudposse/terraform-aws-backup/commits
- name: Slack Community
image: https://slack.cloudposse.com/for-the-badge.svg
url: https://slack.cloudposse.com
# List any related terraform modules that this module may be used with or that this module depends on.
related:
- name: "terraform-aws-efs"
description: "Terraform module to provision EFS file system"
url: "https://github.com/cloudposse/terraform-aws-efs"
- name: "terraform-aws-efs-backup"
description: "Terraform module to backup EFS filesystems to S3 using DataPipeline"
url: "https://github.com/cloudposse/terraform-aws-efs-backup"
- name: "terraform-aws-efs-cloudwatch-sns-alarms"
description: "Terraform module that configures CloudWatch SNS alerts for EFS"
url: "https://github.com/cloudposse/terraform-aws-efs-cloudwatch-sns-alarms"
# Short description of this project
description: |-
Terraform module to provision [AWS Backup](https://aws.amazon.com/backup), a fully managed backup service that makes it easy to centralize and automate
the back up of data across AWS services such as Amazon EBS volumes, Amazon EC2 instances, Amazon RDS databases, Amazon DynamoDB tables,
Amazon EFS file systems, and AWS Storage Gateway volumes.
> [!NOTE]
> The syntax of declaring a backup schedule has changed as of release `0.14.0`, follow the instructions in the [0.13.x to 0.14.x+ migration guide](./docs/migration-0.13.x-0.14.x+.md).
> [!WARNING]
> The deprecated variables have been fully deprecated as of `1.x.x`. Please use the new variables as described in the [0.13.x to 0.14.x+ migration guide](./docs/migration-0.13.x-0.14.x+.md).
# How to use this project
usage: |2-
For a complete example on how to backup an Elastic File System (EFS), see [examples/complete](examples/complete).
For automated tests of the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest)
(which tests and deploys the example on AWS), see [`test`](test).
```hcl
provider "aws" {
region = var.region
}
module "vpc" {
source = "cloudposse/vpc/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
namespace = var.namespace
stage = var.stage
name = var.name
attributes = var.attributes
tags = var.tags
delimiter = var.delimiter
ipv4_primary_cidr_block = "172.16.0.0/16"
}
module "subnets" {
source = "cloudposse/dynamic-subnets/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
namespace = var.namespace
stage = var.stage
name = var.name
attributes = var.attributes
tags = var.tags
delimiter = var.delimiter
availability_zones = var.availability_zones
vpc_id = module.vpc.vpc_id
igw_id = [module.vpc.igw_id]
ipv4_cidr_block = module.vpc.vpc_cidr_block
nat_gateway_enabled = false
nat_instance_enabled = false
}
module "efs" {
source = "cloudposse/efs/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
namespace = var.namespace
stage = var.stage
name = var.name
attributes = var.attributes
tags = var.tags
delimiter = var.delimiter
region = var.region
availability_zones = var.availability_zones
vpc_id = module.vpc.vpc_id
subnets = module.subnets.private_subnet_ids
allowed_security_group_ids = [module.vpc.vpc_default_security_group_id]
}
module "backup" {
source = "cloudposse/backup/aws"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
namespace = var.namespace
stage = var.stage
name = var.name
attributes = var.attributes
tags = var.tags
delimiter = var.delimiter
plan_name_suffix = var.plan_name_suffix
vault_enabled = var.vault_enabled
iam_role_enabled = var.iam_role_enabled
plan_enabled = var.plan_enabled
selection_tags = var.selection_tags
backup_resources = [module.efs.arn]
not_resources = var.not_resources
rules = var.rules
kms_key_arn = var.kms_key_arn
advanced_backup_setting = var.advanced_backup_setting
backup_vault_lock_configuration = var.backup_vault_lock_configuration
}
```
In the above example `var.rules` could be defined as follows:
```hcl
rules = [
{
name = "${module.this.name}-daily"
schedule = var.schedule
start_window = var.start_window
completion_window = var.completion_window
lifecycle = {
cold_storage_after = var.cold_storage_after
delete_after = var.delete_after
}
}
]
```
or as yaml
```yaml
rules:
- name: "plan-daily"
schedule: "cron(0 5 ? * * *)"
start_window: 320 # 60 * 8 # minutes
completion_window: 10080 # 60 * 24 * 7 # minutes
delete_after: 35 # 7 * 5
```
include:
- "docs/targets.md"
- "docs/terraform.md"
# Contributors to this project
contributors: []