-
Notifications
You must be signed in to change notification settings - Fork 18
/
cf-exports.tf
21 lines (21 loc) · 1.12 KB
/
cf-exports.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
resource "aws_cloudformation_stack" "tf_exports" {
name = "terraform-exports-network-${var.name}"
template_body = templatefile("${path.module}/cf-exports.yml", {
"name" = var.cf_export_name != "" ? var.cf_export_name : var.name
"vars" = {
"VpcId" = aws_vpc.default.id,
"CidrBlock" = aws_vpc.default.cidr_block,
"InternetGatewayId" = aws_internet_gateway.default.id,
"PublicSubnetIds" = join(",", aws_subnet.public.*.id),
"PublicSubnetCidrs" = join(",", aws_subnet.public.*.cidr_block),
"PrivateSubnetIds" = join(",", aws_subnet.private.*.id),
"PrivateSubnetCidrs" = join(",", aws_subnet.private.*.cidr_block),
"SecureSubnetIds" = join(",", aws_subnet.secure.*.id),
"SecureSubnetCidrs" = join(",", aws_subnet.secure.*.cidr_block),
"NatGatewayIds" = var.nat ? join(",", aws_nat_gateway.nat_gw.*.id) : "undefined",
"DbSubnetGroupId" = aws_db_subnet_group.secure[0].id,
"DbSubnetPrivateGroupId" = try(aws_db_subnet_group.private[0].id,"")
"DbSubnetPublicGroupId" = try(aws_db_subnet_group.public[0].id,"")
}
})
}