-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
81 lines (56 loc) · 2.25 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
module "collection" {
source = "./modules/collection"
for_each = { for k, v in var.collection : k => v if var.create_collection }
create = try(each.value.create, true)
name = each.value.name
description = try(each.value.description, true)
standby_replicas = try(each.value.standby_replicas, null)
tags = merge(var.tags, try(each.value.tags, {}))
type = try(each.value.type, true)
depends_on = [module.security_policy]
}
module "access_policy" {
source = "./modules/access_policy"
for_each = { for k, v in var.access_policy : k => v if var.create_access_policy }
create = try(each.value.create, true)
name = each.value.name
description = try(each.value.description, null)
policy = each.value.policy
type = try(each.value.type, "data")
}
module "lifecycle_policy" {
source = "./modules/lifecycle_policy"
for_each = { for k, v in var.lifecycle_policy : k => v if var.create_lifecycle_policy }
create = try(each.value.create, true)
name = each.value.name
description = try(each.value.description, null)
policy = each.value.policy
type = try(each.value.type, "retention")
}
module "security_config" {
source = "./modules/security_config"
for_each = { for k, v in var.security_config : k => v if var.create_security_config }
create = try(each.value.create, true)
name = each.value.name
description = try(each.value.description, null)
type = try(each.value.type, "saml")
saml_options = each.value.saml_options
}
module "security_policy" {
source = "./modules/security_policy"
for_each = { for k, v in var.security_policy : k => v if var.create_security_policy }
create = try(each.value.create, true)
name = each.value.name
description = try(each.value.description, null)
policy = each.value.policy
type = each.value.type
}
module "vpc_endpoint" {
source = "./modules/vpc_endpoint"
for_each = { for k, v in var.vpc_endpoint : k => v if var.create_vpc_endpoint }
create = try(each.value.create, true)
name = each.value.name
security_group_ids = try(each.value.security_group_ids, null)
subnet_ids = each.value.subnet_ids
vpc_id = each.value.vpc_id
}