-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
29 lines (26 loc) · 1.09 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
# Replace the null_resource and local_file data source with external data source
data "external" "get_environment" {
program = ["bash", "${path.module}/scripts/get_environment.sh"]
query = {
control_plane_url = var.control_plane_url
api_key = var.tfy_api_key
stdout_log_file = var.stdout_log_file
stderr_log_file = var.stderr_log_file
always_update = var.always_update ? timestamp() : "initial"
}
}
data "external" "create_cluster" {
program = ["bash", "${path.module}/scripts/setup_truefoundry_cluster.sh"]
depends_on = [data.external.get_environment]
query = {
control_plane_url = var.control_plane_url
api_key = var.tfy_api_key
cluster_name = var.cluster_name
cluster_type = var.cluster_type
cluster_config_base64 = base64encode(local.cluster_config)
provider_config_base64 = base64encode(local.provider_account_config)
stdout_log_file = var.stdout_log_file
stderr_log_file = var.stderr_log_file
always_update = var.always_update ? timestamp() : "initial"
}
}