-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables-storage.tf
192 lines (167 loc) · 6.35 KB
/
variables-storage.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
# Storage account parameters
variable "is_premium" {
description = "True to enable `Premium` tier for this Storage Account."
type = bool
default = true
nullable = false
}
variable "account_replication_type" {
description = "Defines the type of replication to use for this Storage Account. Valid options are `LRS`, `GRS`, `RAGRS`, `ZRS`, `GZRS` and `RAGZRS`."
type = string
default = "ZRS"
nullable = false
}
variable "https_traffic_only_enabled" {
description = "Boolean flag which forces HTTPS if enabled. Disabled if any NFS file share is provisioned."
type = bool
default = true
nullable = false
}
variable "min_tls_version" {
description = "The minimum supported TLS version for the Storage Account. Possible values are `TLS1_0`, `TLS1_1`, and `TLS1_2`. "
type = string
default = "TLS1_2"
nullable = false
}
variable "shared_access_key_enabled" {
description = "Indicates whether the Storage Account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD)."
type = bool
default = false
nullable = false
}
# Identity
variable "identity_type" {
description = "Specifies the type of Managed Service Identity that should be configured on this Storage Account. Possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned` (to enable both)."
type = string
default = "SystemAssigned"
}
variable "identity_ids" {
description = "Specifies a list of User Assigned Managed Identity IDs to be assigned to this Storage Account."
type = list(string)
default = null
}
# Storage Firewall
variable "network_rules_enabled" {
description = "Boolean to enable Network Rules on the Storage Account, requires `network_bypass`, `allowed_cidrs`, `subnet_ids` or `default_firewall_action` correctly set if enabled."
type = bool
default = true
nullable = false
}
variable "network_bypass" {
description = "Specifies whether traffic is bypassed for 'Logging', 'Metrics', 'AzureServices' or 'None'."
type = list(string)
default = ["Logging", "Metrics", "AzureServices"]
}
variable "allowed_cidrs" {
description = "List of CIDR to allow access to that Storage Account."
type = list(string)
default = []
nullable = false
}
variable "subnet_ids" {
description = "Subnets to allow access to that Storage Account."
type = list(string)
default = []
nullable = false
}
variable "default_firewall_action" {
description = "Which default firewalling policy to apply. Valid values are `Allow` or `Deny`."
type = string
default = "Deny"
nullable = false
}
# Threat protection
variable "advanced_threat_protection_enabled" {
description = "Boolean flag which controls if advanced threat protection is enabled, see [documentation](https://docs.microsoft.com/en-us/azure/storage/common/storage-advanced-threat-protection?tabs=azure-portal) for more information."
type = bool
default = false
nullable = false
}
# Data creation/bootstrap
variable "file_shares" {
description = "List of objects to create some File Shares in this Storage Account."
type = list(object({
name = string
quota_in_gb = number
protocol_enabled = optional(string)
metadata = optional(map(string))
acl = optional(list(object({
id = string
permissions = string
start = optional(string)
expiry = optional(string)
})))
}))
}
variable "file_share_cors_rules" {
description = "Storage Account file shares CORS rule. Please refer to the [documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account#cors_rule) for more information."
type = object({
allowed_headers = list(string)
allowed_methods = list(string)
allowed_origins = list(string)
exposed_headers = list(string)
max_age_in_seconds = number
})
default = null
}
variable "file_share_retention_policy_in_days" {
description = "Storage Account file shares retention policy in days."
type = number
default = 14
nullable = false
}
variable "file_share_properties_smb" {
description = "Storage Account file shares SMB properties. Multichannel is enabled by default on Premium Storage Accounts."
type = object({
versions = optional(list(string), null)
authentication_types = optional(list(string), null)
kerberos_ticket_encryption_type = optional(list(string), null)
channel_encryption_type = optional(list(string), null)
multichannel_enabled = optional(bool, null)
})
default = null
}
# Backup
variable "backup_policy_id" {
description = "ID of the Recovery Services Vault policy for file share backups."
type = string
}
variable "file_share_authentication" {
description = "Storage Account file shares authentication configuration."
type = object({
directory_type = string
active_directory = optional(object({
storage_sid = string
domain_name = string
domain_sid = string
domain_guid = string
forest_name = string
netbios_domain_name = string
}))
})
default = null
validation {
condition = var.file_share_authentication == null || (
contains(["AADDS", "AD", ""], try(var.file_share_authentication.directory_type, ""))
)
error_message = "`file_share_authentication.directory_type` can only be `AADDS` or `AD`."
}
validation {
condition = var.file_share_authentication == null || (
try(var.file_share_authentication.directory_type, null) == "AADDS" || (
try(var.file_share_authentication.directory_type, null) == "AD" &&
try(var.file_share_authentication.active_directory, null) != null
)
)
error_message = "`file_share_authentication.active_directory` block is required when `file_share_authentication.directory_type` is set to `AD`."
}
}
variable "private_link_access" {
description = "List of Private Link objects to allow access from."
type = list(object({
endpoint_resource_id = string
endpoint_tenant_id = optional(string, null)
}))
default = []
nullable = false
}