blob: 6941a063b0140e8bb4551cdc30cb2233bbcd4253 (
plain) (
blame)
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
|
locals {
cidr_block = "10.32.0.0/16"
subnets = cidrsubnets(local.cidr_block, 4, 4, 4, 4, 4, 4)
subnet_groups = chunklist(local.subnets, 3)
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "3.18.1"
name = local.name
cidr = local.cidr_block
azs = data.aws_availability_zones.available.names
private_subnets = local.subnet_groups[0]
public_subnets = local.subnet_groups[1]
enable_dns_hostnames = true
enable_dns_support = true
enable_nat_gateway = false
single_nat_gateway = true
}
resource "aws_db_subnet_group" "mastodon" {
name = var.name
subnet_ids = module.vpc.public_subnets
tags = {
Name = var.name
}
}
|