-
Notifications
You must be signed in to change notification settings - Fork 1
/
vpc.tf
62 lines (53 loc) · 1.4 KB
/
vpc.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
data "aws_availability_zones" "available" {
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
state = "available"
}
data "aws_caller_identity" "current" {}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "3.14.2"
name = local.name
azs = data.aws_availability_zones.available.names
cidr = var.vpc_cidr
private_subnets = var.private_subnets
public_subnets = var.public_subnets
manage_default_route_table = true
default_route_table_tags = { DefaultRouteTable = true }
enable_nat_gateway = true
single_nat_gateway = true
enable_dns_hostnames = true
enable_dns_support = true
}
# Security Group for the HashiCups deployment.
# Note that this allows wide open ingress and egress from the public internet
# and is not suitable for production environments.
resource "aws_security_group" "this" {
vpc_id = module.vpc.vpc_id
ingress {
from_port = 0
protocol = "-1"
to_port = 0
cidr_blocks = ["0.0.0.0/0"]
}
ingress {
from_port = 0
protocol = "-1"
to_port = 0
self = true
}
egress {
from_port = 0
protocol = "-1"
to_port = 0
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
protocol = "-1"
to_port = 0
self = true
}
}