-
Notifications
You must be signed in to change notification settings - Fork 18
/
db-subnet.tf
45 lines (39 loc) · 1.34 KB
/
db-subnet.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
resource "aws_db_subnet_group" "secure" {
count = var.create_dbsubgroup_secure ? 1 : 0
name = lower("${format(local.names[var.name_pattern].db_subnet, var.name, local.name_suffix)}-secure")
subnet_ids = aws_subnet.secure.*.id
tags = merge(
var.tags,
{
"Name" = "${format(local.names[var.name_pattern].db_subnet, var.name, local.name_suffix)}-secure"
"Scheme" = "secure"
"EnvName" = var.name
},
)
}
resource "aws_db_subnet_group" "private" {
count = var.create_dbsubgroup_private ? 1 : 0
name = lower("${format(local.names[var.name_pattern].db_subnet, var.name, local.name_suffix)}-private")
subnet_ids = aws_subnet.private.*.id
tags = merge(
var.tags,
{
"Name" = "${format(local.names[var.name_pattern].db_subnet, var.name, local.name_suffix)}-private"
"Scheme" = "private"
"EnvName" = var.name
},
)
}
resource "aws_db_subnet_group" "public" {
count = var.create_dbsubgroup_public ? 1 : 0
name = lower("${format(local.names[var.name_pattern].db_subnet, var.name, local.name_suffix)}-public")
subnet_ids = aws_subnet.public.*.id
tags = merge(
var.tags,
{
"Name" = "${format(local.names[var.name_pattern].db_subnet, var.name, local.name_suffix)}-public"
"Scheme" = "public"
"EnvName" = var.name
},
)
}