-
Notifications
You must be signed in to change notification settings - Fork 2
/
variables.tf
210 lines (178 loc) · 6.57 KB
/
variables.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# -------------------------------------------------------------------------------------------------
# VPC (required)
# -------------------------------------------------------------------------------------------------
variable "vpc_cidr" {
description = "The VPC CIDR to use for this VPC."
type = string
}
variable "vpc_subnet_azs" {
description = "A list of AZ's to use to spawn subnets over"
type = list(string)
}
variable "vpc_private_subnets" {
description = "A list of private subnet CIDR's"
type = list(string)
}
variable "vpc_public_subnets" {
description = "A list of public subnet CIDR's"
type = list(string)
}
variable "name" {
description = "The name(-prefix) to prepend/apply to all Name tags on all VPC resources"
type = string
}
# -------------------------------------------------------------------------------------------------
# VPC (optional)
# -------------------------------------------------------------------------------------------------
variable "vpc_enable_nat_gateway" {
description = "A boolean that enables or disables NAT gateways for private subnets"
type = bool
default = true
}
variable "vpc_one_nat_gateway_per_az" {
description = "Should be true if you want only one NAT Gateway per availability zone. Requires `var.azs` to be set, and the number of `public_subnets` created to be greater than or equal to the number of availability zones specified in `var.azs`"
type = bool
default = true
}
variable "vpc_reuse_nat_ips" {
description = "Should be true if you don't want EIPs to be created for your NAT Gateways and will instead pass them in via the 'external_nat_ip_ids' variable"
type = bool
default = false
}
variable "vpc_external_nat_ip_names" {
description = <<EOF
"List of names used to select the allocated EIP(s) that will be associated with the NAT GW(s). These EIPs can be managed outside of this module but they should be with Terraform and should be part of the same state as this module's resources. In case you have an uneven distribution of subnets in your AZs (i.e. you use 2 AZs but create 3 private subnets) and you want to use externally managed EIPs with one NAT GW per AZ, you have to provide as many EIPs as NAT GWs. Otherwise you will see this in the EIPs state message: Elastic IP address [eipalloc-xxx] is already associated."
EOF
type = list(string)
default = []
}
variable "vpc_enable_dns_hostnames" {
description = "Should be true to enable DNS hostnames in the VPC"
type = bool
default = false
}
variable "vpc_enable_dns_support" {
description = "Should be true to enable DNS support in the VPC"
type = bool
default = true
}
variable "vpc_enable_vpn_gateway" {
description = "A boolean that enables or disables a VPN gateways for the VPC"
type = bool
default = false
}
variable "vpc_customer_gateways" {
description = "Maps of Customer Gateway's attributes (BGP ASN and Gateway's Internet-routable external IP address)"
type = map(map(any))
default = {}
}
variable "vpc_enable_bastion_host" {
description = "A boolean that enables or disables the deployment of a bastion host in the private subnet with an ELB in front of it"
type = bool
default = false
}
variable "vpc_secondary_cidr_blocks" {
description = "List of secondary CIDR blocks to associate with the VPC to extend the IP Address pool"
type = list(string)
default = []
}
# -------------------------------------------------------------------------------------------------
# Resource Tagging (optional)
# -------------------------------------------------------------------------------------------------
variable "tags" {
description = "A map of additional tags to apply to all VPC resources"
type = map(string)
default = {}
}
variable "vpc_tags" {
description = "A map of additional tags to apply to the VPC"
type = map(string)
default = {}
}
variable "public_subnet_tags" {
description = "A map of additional tags to apply to all public subnets"
type = map(string)
default = {
Visibility = "public"
}
}
variable "private_subnet_tags" {
description = "A map of additional tags to apply to all private subnets"
type = map(string)
default = {
Visibility = "private"
}
}
# -------------------------------------------------------------------------------------------------
# Bastion Host (optional)
# -------------------------------------------------------------------------------------------------
variable "bastion_name" {
description = "If not empty will overwrite the bastion host name specified by 'name'"
type = string
default = ""
}
variable "bastion_ssh_user" {
description = "User name used for SSH-connections."
type = string
default = "ec2-user"
}
variable "bastion_ssh_keys" {
description = "A list of public ssh keys to add to authorized_keys file"
type = list(string)
default = []
}
variable "bastion_ssh_cidr_blocks" {
description = "A list of CIDR's from which one can connect to the bastion host ELB"
type = list(string)
default = ["0.0.0.0/0"]
}
variable "bastion_security_group_names" {
description = "List of one or more security groups to be added to the load balancer"
type = list(string)
default = []
}
variable "bastion_route53_public_dns_name" {
description = "If set, the bastion ELB will be assigned this public DNS name via Route53."
type = string
default = ""
}
variable "bastion_ami" {
description = "EC2 AMI ID for bastion host."
type = string
default = null
}
variable "bastion_instance_type" {
description = "EC2 instance type of bastion host."
type = string
default = "t2.micro"
}
variable "bastion_cluster_size" {
description = "The number of Bastion host server nodes to deploy."
type = number
default = 1
}
variable "manage_default_security_group" {
description = "Should be true to adopt and manage default security group"
type = bool
default = true
}
variable "default_security_group_ingress" {
description = "List of maps of ingress rules to set on the default security group"
type = list(map(string))
default = [{
protocol = -1
self = true
from_port = 0
to_port = 0
}]
}
variable "default_security_group_egress" {
description = "List of maps of egress rules to set on the default security group"
type = list(map(string))
default = [{
protocol = "-1"
self = true
from_port = 0
to_port = 0
}]
}