aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2023-01-31 14:24:47 -0800
committerclarkzjw <[email protected]>2023-01-31 14:24:47 -0800
commit55bf0526c86c88f5ae0d20bad6587c72cd91e835 (patch)
tree286340ac38a8f4558baa985fe6f364a9d8261a63 /infra/vpc.tf
parent0d9b8b4a4a2bb936744a338d1e7a42f2bd2272c9 (diff)
downloadzjw.social-55bf0526c86c88f5ae0d20bad6587c72cd91e835.tar.gz
add ec2, rds
Diffstat (limited to 'infra/vpc.tf')
-rw-r--r--infra/vpc.tf29
1 files changed, 29 insertions, 0 deletions
diff --git a/infra/vpc.tf b/infra/vpc.tf
new file mode 100644
index 0000000..6941a06
--- /dev/null
+++ b/infra/vpc.tf
@@ -0,0 +1,29 @@
1locals {
2 cidr_block = "10.32.0.0/16"
3 subnets = cidrsubnets(local.cidr_block, 4, 4, 4, 4, 4, 4)
4 subnet_groups = chunklist(local.subnets, 3)
5}
6
7module "vpc" {
8 source = "terraform-aws-modules/vpc/aws"
9 version = "3.18.1"
10
11 name = local.name
12 cidr = local.cidr_block
13 azs = data.aws_availability_zones.available.names
14 private_subnets = local.subnet_groups[0]
15 public_subnets = local.subnet_groups[1]
16 enable_dns_hostnames = true
17 enable_dns_support = true
18 enable_nat_gateway = false
19 single_nat_gateway = true
20}
21
22resource "aws_db_subnet_group" "mastodon" {
23 name = var.name
24 subnet_ids = module.vpc.public_subnets
25
26 tags = {
27 Name = var.name
28 }
29}
Powered by cgit v1.2.3 (git 2.41.0)