-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvariables.tf
More file actions
160 lines (135 loc) · 5.06 KB
/
variables.tf
File metadata and controls
160 lines (135 loc) · 5.06 KB
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
##-----------------------------------------------------------------------------
## Naming convention
##-----------------------------------------------------------------------------
variable "custom_name" {
type = string
default = null
description = "Override default naming convention"
}
variable "resource_position_prefix" {
type = bool
default = true
description = <<EOT
Controls the placement of the resource type keyword (e.g., "vnet", "ddospp") in the resource name.
- If true, the keyword is prepended: "vnet-core-dev".
- If false, the keyword is appended: "core-dev-vnet".
This helps maintain naming consistency based on organizational preferences.
EOT
}
##-----------------------------------------------------------------------------
## Labels
##-----------------------------------------------------------------------------
variable "name" {
type = string
default = null
description = "Name (e.g. `app` or `cluster`)."
}
variable "location" {
type = string
default = null
description = "The location/region where the virtual network is created. Changing this forces a new resource to be created."
}
variable "environment" {
type = string
default = null
description = "Environment (e.g. `prod`, `dev`, `staging`)."
}
variable "managedby" {
type = string
default = "terraform-az-modules"
description = "ManagedBy, eg 'terraform-az-modules'."
}
variable "label_order" {
type = list(string)
default = ["name", "environment", "location"]
description = "The order of labels used to construct resource names or tags. If not specified, defaults to ['name', 'environment', 'location']."
}
variable "repository" {
type = string
default = "https://github.com/terraform-az-modules/terraform-azure-vnet"
description = "Terraform current module repo"
validation {
# regex(...) fails if it cannot find a match
condition = can(regex("^https://", var.repository))
error_message = "The module-repo value must be a valid Git repo link."
}
}
variable "deployment_mode" {
type = string
default = "terraform"
description = "Specifies how the infrastructure/resource is deployed"
}
variable "extra_tags" {
type = map(string)
default = null
description = "Variable to pass extra tags."
}
##-----------------------------------------------------------------------------
## Vnet
##-----------------------------------------------------------------------------
variable "enable" {
type = bool
default = true
description = "Flag to control the module creation"
}
variable "resource_group_name" {
type = string
default = null
description = "The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created."
}
variable "address_spaces" {
type = list(string)
default = []
description = "The list of the address spaces that is used by the virtual network."
}
variable "flow_timeout_in_minutes" {
type = number
default = null
description = "The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes."
}
# If no values specified, this defaults to Azure DNS
variable "dns_servers" {
type = list(string)
default = []
description = "The DNS servers to be used with vNet."
}
variable "bgp_community" {
type = number
default = null
description = "The BGP community attribute in format <as-number>:<community-value>."
}
variable "edge_zone" {
type = string
default = null
description = " (Optional) Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created."
}
variable "enable_encryption_settings" {
type = string
default = null
description = "Specifies if the encrypted Virtual Network allows VM that does not support encryption. Possible values are DropUnencrypted and AllowUnencrypted."
}
##-----------------------------------------------------------------------------
## DDOS Protection Plan
##-----------------------------------------------------------------------------
variable "enable_ddos_pp" {
type = bool
default = false
description = "Flag to control the resource creation"
}
variable "existing_ddos_pp" {
type = string
default = null
description = "ID of an existing DDOS protection plan defined in the same subscription."
validation {
condition = !(var.enable_ddos_pp && var.existing_ddos_pp != null)
error_message = "You cannot set both 'enable_ddos_pp = true' and 'existing_ddos_pp' at the same time. Provide only one."
}
}
##-----------------------------------------------------------------------------
## Network Watcher
##-----------------------------------------------------------------------------
variable "enable_network_watcher" {
type = bool
default = false
description = "Flag to control creation of network watcher."
}