-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmain.tf
252 lines (198 loc) · 10.6 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# Copyright 2023 Cloudera, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------- Call sub-module for AWS Deployment -------
module "cdp_on_aws" {
count = (var.infra_type == "aws") ? 1 : 0
source = "./modules/aws"
tags = local.env_tags
environment_name = local.environment_name
environment_description = var.environment_description
datalake_name = local.datalake_name
create_cdp_credential = var.create_cdp_credential
cdp_xacccount_credential_name = local.cdp_xacccount_credential_name
cdp_admin_group_name = local.cdp_admin_group_name
cdp_user_group_name = local.cdp_user_group_name
security_group_default_id = var.aws_security_group_default_id
security_group_knox_id = var.aws_security_group_knox_id
security_access_cidr = var.aws_security_access_cidr
datalake_scale = local.datalake_scale
datalake_version = var.datalake_version
enable_ccm_tunnel = var.enable_ccm_tunnel
enable_raz = var.enable_raz
multiaz = var.multiaz
freeipa_instances = var.freeipa_instances
workload_analytics = var.workload_analytics
endpoint_access_scheme = local.endpoint_access_scheme
environment_async_creation = var.environment_async_creation
environment_call_failure_threshold = var.environment_call_failure_threshold
environment_polling_timeout = var.environment_polling_timeout
datalake_async_creation = var.datalake_async_creation
datalake_call_failure_threshold = var.datalake_call_failure_threshold
datalake_polling_timeout = var.datalake_polling_timeout
region = var.region
vpc_id = var.aws_vpc_id
public_subnet_ids = var.aws_public_subnet_ids
# private_subnet_ids = var.aws_private_subnet_ids
subnets_for_cdp = local.aws_subnets_for_cdp
# One of key settings below need to be set
keypair_name = var.keypair_name
public_key_text = var.public_key_text
data_storage_location = var.data_storage_location
log_storage_location = var.log_storage_location
backup_storage_location = var.backup_storage_location
xaccount_role_arn = var.aws_xaccount_role_arn
datalake_admin_role_arn = var.aws_datalake_admin_role_arn
ranger_audit_role_arn = var.aws_ranger_audit_role_arn
raz_role_arn = var.aws_raz_role_arn
idbroker_instance_profile_arn = var.aws_idbroker_instance_profile_arn
log_instance_profile_arn = var.aws_log_instance_profile_arn
# Optional parameters defaulting to null
freeipa_catalog = var.freeipa_catalog
freeipa_image_id = var.freeipa_image_id
freeipa_instance_type = var.freeipa_instance_type
freeipa_recipes = var.freeipa_recipes
freeipa_os = var.freeipa_os
encryption_key_arn = var.encryption_key_arn
proxy_config_name = var.proxy_config_name
s3_guard_table_name = var.s3_guard_table_name
datalake_image = var.datalake_image
datalake_java_version = var.datalake_java_version
datalake_recipes = var.datalake_recipes
environment_cascading_delete = var.environment_cascading_delete
}
# ------- Call sub-module for Azure Deployment -------
module "cdp_on_azure" {
count = (var.infra_type == "azure") ? 1 : 0
source = "./modules/azure"
tags = local.env_tags
environment_name = local.environment_name
environment_description = var.environment_description
datalake_name = local.datalake_name
create_cdp_credential = var.create_cdp_credential
cdp_xacccount_credential_name = local.cdp_xacccount_credential_name
cdp_admin_group_name = local.cdp_admin_group_name
cdp_user_group_name = local.cdp_user_group_name
security_group_default_uri = var.azure_security_group_default_uri
security_group_knox_uri = var.azure_security_group_knox_uri
security_access_cidr = var.azure_security_access_cidr
datalake_scale = local.datalake_scale
datalake_version = var.datalake_version
enable_ccm_tunnel = var.enable_ccm_tunnel
enable_raz = var.enable_raz
multiaz = var.multiaz
freeipa_instances = var.freeipa_instances
workload_analytics = var.workload_analytics
endpoint_access_scheme = local.endpoint_access_scheme
environment_async_creation = var.environment_async_creation
environment_call_failure_threshold = var.environment_call_failure_threshold
environment_polling_timeout = var.environment_polling_timeout
datalake_async_creation = var.datalake_async_creation
datalake_call_failure_threshold = var.datalake_call_failure_threshold
datalake_polling_timeout = var.datalake_polling_timeout
azure_accept_image_terms = var.azure_accept_image_terms
use_single_resource_group = var.use_single_resource_group
use_public_ips = local.use_public_ips
subscription_id = var.azure_subscription_id
tenant_id = var.azure_tenant_id
region = var.region
resource_group_name = var.azure_resource_group_name
vnet_name = var.azure_vnet_name
cdp_subnet_names = var.azure_cdp_subnet_names
cdp_gateway_subnet_names = var.azure_cdp_gateway_subnet_names
environment_flexible_server_delegated_subnet_names = var.azure_environment_flexible_server_delegated_subnet_names
public_key_text = var.public_key_text
data_storage_location = var.data_storage_location
log_storage_location = var.log_storage_location
backup_storage_location = var.backup_storage_location
xaccount_app_uuid = var.azure_xaccount_app_uuid
xaccount_app_pword = var.azure_xaccount_app_pword
idbroker_identity_id = var.azure_idbroker_identity_id
datalakeadmin_identity_id = var.azure_datalakeadmin_identity_id
ranger_audit_identity_id = var.azure_ranger_audit_identity_id
log_identity_id = var.azure_log_identity_id
raz_identity_id = var.azure_raz_identity_id
# Optional parameters defaulting to null
freeipa_catalog = var.freeipa_catalog
freeipa_image_id = var.freeipa_image_id
freeipa_instance_type = var.freeipa_instance_type
freeipa_recipes = var.freeipa_recipes
freeipa_os = var.freeipa_os
enable_outbound_load_balancer = var.enable_outbound_load_balancer
load_balancer_sku = var.azure_load_balancer_sku
encryption_key_resource_group_name = var.encryption_key_resource_group_name
encryption_key_url = var.encryption_key_url
encryption_at_host = var.encryption_at_host
encryption_user_managed_identity = var.encryption_user_managed_identity
azure_aks_private_dns_zone_id = var.azure_aks_private_dns_zone_id
azure_database_private_dns_zone_id = var.azure_database_private_dns_zone_id
create_private_endpoints = var.azure_create_private_endpoints
proxy_config_name = var.proxy_config_name
datalake_image = var.datalake_image
datalake_java_version = var.datalake_java_version
datalake_recipes = var.datalake_recipes
datalake_flexible_server_delegated_subnet_name = var.azure_datalake_flexible_server_delegated_subnet_name
environment_cascading_delete = var.environment_cascading_delete
}
# ------- Call sub-module for GCP Deployment -------
module "cdp_on_gcp" {
count = (var.infra_type == "gcp") ? 1 : 0
source = "./modules/gcp"
tags = local.env_tags
environment_name = local.environment_name
environment_description = var.environment_description
datalake_name = local.datalake_name
create_cdp_credential = var.create_cdp_credential
cdp_xacccount_credential_name = local.cdp_xacccount_credential_name
cdp_admin_group_name = local.cdp_admin_group_name
cdp_user_group_name = local.cdp_user_group_name
firewall_default_id = var.gcp_firewall_default_id
firewall_knox_id = var.gcp_firewall_knox_id
datalake_scale = local.datalake_scale
datalake_version = var.datalake_version
enable_raz = var.enable_raz
enable_ccm_tunnel = var.enable_ccm_tunnel
freeipa_instances = var.freeipa_instances
freeipa_instance_type = var.freeipa_instance_type
freeipa_recipes = var.freeipa_recipes
workload_analytics = var.workload_analytics
endpoint_access_scheme = local.endpoint_access_scheme
availability_zones = var.gcp_availability_zones
environment_async_creation = var.environment_async_creation
environment_call_failure_threshold = var.environment_call_failure_threshold
environment_polling_timeout = var.environment_polling_timeout
datalake_async_creation = var.datalake_async_creation
datalake_call_failure_threshold = var.datalake_call_failure_threshold
datalake_polling_timeout = var.datalake_polling_timeout
use_public_ips = local.use_public_ips
project_id = var.gcp_project_id
region = var.region
network_name = var.gcp_network_name
cdp_subnet_names = var.gcp_cdp_subnet_names
public_key_text = var.public_key_text
data_storage_location = var.data_storage_location
log_storage_location = var.log_storage_location
backup_storage_location = var.backup_storage_location
xaccount_service_account_private_key = var.gcp_xaccount_service_account_private_key
proxy_config_name = var.proxy_config_name
encryption_key = var.gcp_encryption_key
idbroker_service_account_email = var.gcp_idbroker_service_account_email
ranger_audit_service_account_email = var.gcp_ranger_audit_service_account_email
datalake_admin_service_account_email = var.gcp_datalake_admin_service_account_email
log_service_account_email = var.gcp_log_service_account_email
raz_service_account_email = var.gcp_raz_service_account_email
datalake_image = var.datalake_image
datalake_java_version = var.datalake_java_version
datalake_recipes = var.datalake_recipes
environment_cascading_delete = var.environment_cascading_delete
}