generated from libre-devops/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
189 lines (172 loc) · 8.88 KB
/
main.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
resource "azurerm_api_management" "apim" {
for_each = { for instance in var.apim_instances : instance.name => instance }
name = each.value.name
resource_group_name = each.value.rg_name
location = each.value.location
tags = each.value.tags
sku_name = each.value.sku_name
publisher_name = each.value.publisher_name
publisher_email = each.value.publisher_email
client_certificate_enabled = each.value.client_cetuficate_enabled
gateway_disabled = each.value.gateway_disabled
min_api_version = each.value.min_api_version
public_ip_address_id = each.value.public_ip_address_id
public_network_access_enabled = each.value.public_network_access_enabled
virtual_network_type = each.value.virtual_network_type
dynamic "additional_location" {
for_each = each.value.additional_location != null ? each.value.additional_location : []
content {
location = additional_location.value.location
capacity = additional_location.value.capacity
zones = additional_location.value.zones
public_ip_address_id = additional_location.value.public_ip_address_id
dynamic "virtual_network_configuration" {
for_each = additional_location.value.virtual_network_configuration != null ? [additional_location.value.virtual_network_configuration] : []
content {
subnet_id = virtual_network_configuration.value.subnet_id
}
}
gateway_disabled = additional_location.value.gateway_disabled
}
}
dynamic "certificate" {
for_each = each.value.certificate != null ? each.value.certificate : []
content {
encoded_certificate = certificate.value.encoded_certificate
store_name = certificate.value.store_name
certificate_password = certificate.value.certificate_password
}
}
dynamic "hostname_configuration" {
for_each = each.value.hostname_configuration != null ? [each.value.hostname_configuration] : []
content {
dynamic "management" {
for_each = try(each.value.hostname_configuration.management, [])
content {
host_name = management.value.host_name
key_vault_id = management.value.key_vault_id
certificate = management.value.certificate
certificate_password = management.value.certificate_password
negotiate_client_certificate = management.value.negotiate_client_certificate
ssl_keyvault_identity_client_id = management.value.ssl_keyvault_identity_client_id
}
}
dynamic "portal" {
for_each = try(each.value.hostname_configuration.portal, [])
content {
host_name = portal.value.host_name
key_vault_id = portal.value.key_vault_id
certificate = portal.value.certificate
certificate_password = portal.value.certificate_password
negotiate_client_certificate = portal.value.negotiate_client_certificate
ssl_keyvault_identity_client_id = portal.value.ssl_keyvault_identity_client_id
}
}
dynamic "developer_portal" {
for_each = try(each.value.hostname_configuration.developer_portal, [])
content {
host_name = developer_portal.value.host_name
key_vault_id = developer_portal.value.key_vault_id
certificate = developer_portal.value.certificate
certificate_password = developer_portal.value.certificate_password
negotiate_client_certificate = developer_portal.value.negotiate_client_certificate
ssl_keyvault_identity_client_id = developer_portal.value.ssl_keyvault_identity_client_id
}
}
dynamic "proxy" {
for_each = try(each.value.hostname_configuration.proxy, [])
content {
default_ssl_binding = proxy.value.default_ssl_binding
host_name = proxy.value.host_name
key_vault_id = proxy.value.key_vault_id
certificate = proxy.value.certificate
certificate_password = proxy.value.certificate_password
negotiate_client_certificate = proxy.value.negotiate_client_certificate
ssl_keyvault_identity_client_id = proxy.value.ssl_keyvault_identity_client_id
}
}
dynamic "scm" {
for_each = try(each.value.hostname_configuration.scm, [])
content {
host_name = scm.value.host_name
key_vault_id = scm.value.key_vault_id
certificate = scm.value.certificate
certificate_password = scm.value.certificate_password
negotiate_client_certificate = scm.value.negotiate_client_certificate
ssl_keyvault_identity_client_id = scm.value.ssl_keyvault_identity_client_id
}
}
}
}
dynamic "delegation" {
for_each = each.value.delegation != null ? [each.value.delegation] : []
content {
subscriptions_enabled = delegation.value.subscriptions_enabled
user_registration_enabled = delegation.value.user_registration_enabled
url = delegation.value.url
validation_key = delegation.value.validation_key
}
}
dynamic "sign_in" {
for_each = each.value.sign_in != null ? [each.value.sign_in] : []
content {
enabled = sign_in.value.enabled
}
}
dynamic "sign_up" {
for_each = each.value.sign_up != null ? [each.value.sign_up] : []
content {
enabled = sign_up.value.enabled
dynamic "terms_of_service" {
for_each = sign_up.value.terms_of_service != null ? [sign_up.value.terms_of_service] : []
content {
enabled = terms_of_service.value.enabled
consent_required = terms_of_service.value.consent_required
text = terms_of_service.value.text
}
}
}
}
dynamic "security" {
for_each = each.value.security != null ? [each.value.security] : []
content {
enable_backend_ssl30 = security.value.enable_backend_ssl30
enable_backend_tls10 = security.value.enable_backend_tls10
enable_backend_tls11 = security.value.enable_backend_tls11
enable_frontend_ssl30 = security.value.enable_frontend_ssl30
enable_frontend_tls10 = security.value.enable_frontend_tls10
enable_frontend_tls11 = security.value.enable_frontend_tls11
tls_ecdhe_ecdsa_with_aes128_cbc_sha_ciphers_enabled = security.value.tls_ecdhe_ecdsa_with_aes128_cbc_sha_ciphers_enabled
tls_ecdhe_ecdsa_with_aes256_cbc_sha_ciphers_enabled = security.value.tls_ecdhe_ecdsa_with_aes256_cbc_sha_ciphers_enabled
tls_ecdhe_rsa_with_aes128_cbc_sha_ciphers_enabled = security.value.tls_ecdhe_rsa_with_aes128_cbc_sha_ciphers_enabled
tls_ecdhe_rsa_with_aes256_cbc_sha_ciphers_enabled = security.value.tls_ecdhe_rsa_with_aes256_cbc_sha_ciphers_enabled
tls_rsa_with_aes128_cbc_sha256_ciphers_enabled = security.value.tls_rsa_with_aes128_cbc_sha256_ciphers_enabled
tls_rsa_with_aes128_cbc_sha_ciphers_enabled = security.value.tls_rsa_with_aes128_cbc_sha_ciphers_enabled
tls_rsa_with_aes128_gcm_sha256_ciphers_enabled = security.value.tls_rsa_with_aes128_gcm_sha256_ciphers_enabled
tls_rsa_with_aes256_gcm_sha384_ciphers_enabled = security.value.tls_rsa_with_aes256_gcm_sha384_ciphers_enabled
tls_rsa_with_aes256_cbc_sha256_ciphers_enabled = security.value.tls_rsa_with_aes256_cbc_sha256_ciphers_enabled
tls_rsa_with_aes256_cbc_sha_ciphers_enabled = security.value.tls_rsa_with_aes256_cbc_sha_ciphers_enabled
triple_des_ciphers_enabled = security.value.triple_des_ciphers_enabled
}
}
dynamic "identity" {
for_each = each.value.identity_type == "SystemAssigned" ? [each.value.identity_type] : []
content {
type = each.value.identity_type
}
}
dynamic "identity" {
for_each = each.value.identity_type == "SystemAssigned, UserAssigned" ? [each.value.identity_type] : []
content {
type = each.value.identity_type
identity_ids = try(each.value.identity_ids, [])
}
}
dynamic "identity" {
for_each = each.value.identity_type == "UserAssigned" ? [each.value.identity_type] : []
content {
type = each.value.identity_type
identity_ids = length(try(each.value.identity_ids, [])) > 0 ? each.value.identity_ids : []
}
}
}