-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
main.tf
95 lines (75 loc) · 2.04 KB
/
main.tf
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
provider "aws" {
region = var.region
}
module "vpc" {
source = "cloudposse/vpc/aws"
version = "2.2.0"
ipv4_primary_cidr_block = "172.16.0.0/16"
context = module.this.context
}
module "subnets" {
source = "cloudposse/dynamic-subnets/aws"
version = "2.4.2"
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]
max_nats = 1
nat_gateway_enabled = true
nat_instance_enabled = false
context = module.this.context
}
module "efs" {
source = "cloudposse/efs/aws"
version = "1.1.0"
region = var.region
vpc_id = module.vpc.vpc_id
subnets = module.subnets.private_subnet_ids
security_groups = [module.vpc.vpc_default_security_group_id]
context = module.this.context
}
module "backup" {
source = "../.."
backup_resources = [module.efs.arn]
not_resources = var.not_resources
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
}
}
]
backup_vault_lock_configuration = {
max_retention_days = 365
min_retention_days = 30
}
context = module.this.context
}
module "backup_disabled" {
source = "../.."
enabled = false
backup_resources = [module.efs.arn]
not_resources = var.not_resources
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
}
}
]
backup_vault_lock_configuration = {
max_retention_days = 365
min_retention_days = 30
}
context = module.this.context
}