-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
116 lines (100 loc) · 2.82 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
###########
# Default #
###########
variable "default_tags" {
description = "Default tags"
type = map(string)
default = {}
}
###################################
# Project and Environment details #
###################################
variable "project_name" {
description = "Name of project"
type = string
}
variable "environment_name" {
description = "Name of environment"
type = string
default = "dev"
}
variable "region_name" {
description = "name of aws region. if not set value, it automatically set providers current region."
type = string
default = null
}
variable "availability_zones" {
description = "list of availability zones which use"
type = list(string)
default = ["a", "b"]
}
#######
# VPC #
#######
variable "vpc_cidr" {
description = "CIDR Block for the VPC"
type = string
validation {
condition = can(cidrnetmask(var.vpc_cidr))
error_message = "Must be a valid IP range in x.x.x.x/x notation"
}
}
#######
# NAT #
#######
variable "without_nat" {
description = "Boolean value for using nat gateway or not"
type = bool
default = false
}
variable "create_nat_per_az" {
description = "Boolean value for create nat gateway per availability zones. If value is true, create nat gateway per azs, if false create only 1 nat gateway and share it"
type = bool
default = true
}
variable "nat_deploy_module" {
description = "The name of the module in which to deploy the NAT gateway. Module is key value of public_subnets variable."
type = string
default = null
}
##################
# Public Subnets #
##################
variable "public_subnets" {
description = "Configurations of public subnet"
type = map(list(string))
validation {
condition = alltrue(concat([for key, cidr_list in var.public_subnets : [
for cidr in cidr_list : can(cidrnetmask(cidr))
]]...))
error_message = "Must be a valid IP range in x.x.x.x/x notation"
}
}
variable "public_subnets_tag" {
description = "Setting tag to specific public subnet"
type = map(map(string))
default = {}
}
variable "public_subnets_map_ip_on_launch" {
description = "Enable map_public_ip_on_launch on public subnet"
type = bool
default = false
}
###################
# Private Subnets #
###################
variable "private_subnets" {
description = "Configurations of private subnet"
type = map(list(string))
validation {
condition = alltrue(concat([for key, cidr_list in var.private_subnets : [
for cidr in cidr_list : can(cidrnetmask(cidr))
]]...))
error_message = "Must be a valid IP range in x.x.x.x/x notation"
}
}
variable "private_subnets_tag" {
description = "Setting tag to specific private subnet"
type = map(map(string))
default = {}
}