-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpc.tf
115 lines (91 loc) · 2.87 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "2.70.0"
name = var.vpc_name
cidr = var.vpc_cidr
azs = var.vpc_azs
private_subnets = var.vpc_private_subnets
public_subnets = var.vpc_public_subnets
enable_nat_gateway = var.vpc_enable_nat_gateway
single_nat_gateway = true
enable_vpn_gateway = var.vpc_enable_vpn_gateway
enable_s3_endpoint = var.vpc_enable_s3_endpoint
enable_dynamodb_endpoint = var.vpc_enable_dynamodb_endpoint
enable_dns_hostnames = var.vpc_enable_dns_hostnames
tags = {
Owner = var.owner
Environment = var.environment
Name = var.vpc_name
}
}
variable "vpc_name" {
description = "The name of the VPC"
}
variable "vpc_cidr" {
description = "The CIDR block for the VPC"
default = "10.0.0.0/16"
}
variable "vpc_azs" {
description = "A list of availability zones in the region"
default = ["us-east-2a"]
}
variable "vpc_private_subnets" {
description = "CIDR blocks for Private Subnets"
default = ["10.0.0.0/19"]
}
variable "vpc_public_subnets" {
description = "CIDR blocks for Public Subnets"
default = ["10.0.32.0/20"]
}
variable "vpc_single_nat_gateway" {
description = "Should be true if you want to provision a single shared NAT Gateway across all of your private networks"
default = false
}
variable "vpc_enable_nat_gateway" {
description = "Provision NAT Gateways for each of your availability zones"
default = true
}
variable "vpc_enable_vpn_gateway" {
description = "Should be true if you want to create a new VPN Gateway resource and attach it to the VPC"
default = true
}
variable "vpc_enable_s3_endpoint" {
description = "Should be true if you want to provision an S3 endpoint to the VPC"
default = true
}
variable "vpc_enable_dynamodb_endpoint" {
description = "Should be true if you want to provision a DynamoDB endpoint to the VPC"
default = true
}
variable "vpc_enable_dns_hostnames" {
description = "Should be true to enable DNS hostnames in the VPC"
default = true
}
output "vpc_id" {
description = "The ID of the VPC"
value = module.vpc.vpc_id
}
output "public_route_table_ids" {
description = "Public route table ids"
value = module.vpc.public_route_table_ids
}
output "private_route_table_ids" {
description = "Private route table ids"
value = module.vpc.private_route_table_ids
}
output "vpc_cidr_block" {
description = "CIDR block for the VPC"
value = module.vpc.vpc_cidr_block
}
output "private_subnets" {
description = "List of IDs of private subnets"
value = [module.vpc.private_subnets]
}
output "public_subnets" {
description = "List of IDs of public subnets"
value = [module.vpc.public_subnets]
}
output "nat_public_ips" {
description = "List of public Elastic IPs created for AWS NAT Gateway"
value = [module.vpc.nat_public_ips]
}