-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelper.tf
62 lines (58 loc) · 2.22 KB
/
helper.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
locals {
tfvars_platform = templatefile("${path.module}/templates/platform.tfvars.hcl", {
project_id = var.project_id,
prefix = var.prefix,
external_domain = var.external_domain,
region = var.region,
dc_name = var.dc_name
use_le_staging = var.use_le_staging
enable_nomad = var.enable_nomad
})
backend_tf_platform = templatefile("${path.module}/templates/backend.hcl", {
key = "platform"
project_id = var.project_id
})
tfvars_appsupport = templatefile("${path.module}/templates/appsupport.tfvars.hcl", {
project_id = var.project_id,
prefix = var.prefix,
external_domain = var.external_domain,
region = var.region
dc_name = var.dc_name
use_le_staging = var.use_le_staging
jenkins_volume_id = lookup(local.volumes_name_to_id, "jenkins", "")
enable_nomad = var.enable_nomad
})
backend_tf_appsupport = templatefile("${path.module}/templates/backend.hcl", {
key = "appsupport"
project_id = var.project_id
})
tfvars_workload = templatefile("${path.module}/templates/workload.tfvars.hcl", {
project_id = var.project_id,
prefix = var.prefix,
external_domain = var.external_domain,
region = var.region
dc_name = var.dc_name
use_le_staging = var.use_le_staging
enable_nomad = var.enable_nomad
})
backend_tf_workload = templatefile("${path.module}/templates/backend.hcl", {
key = "workload"
project_id = var.project_id
})
}
resource "local_file" "tfvars_platform" {
filename = "${path.module}/../caravan-platform/${var.prefix}-gcp.tfvars"
content = local.tfvars_platform
}
resource "local_file" "backend_tf_platform" {
filename = "${path.module}/../caravan-platform/${var.prefix}-gcp-backend.tf.bak"
content = local.backend_tf_platform
}
resource "local_file" "tfvars_appsupport" {
filename = "${path.module}/../caravan-application-support/${var.prefix}-gcp.tfvars"
content = local.tfvars_appsupport
}
resource "local_file" "backend_tf_appsupport" {
filename = "${path.module}/../caravan-application-support/${var.prefix}-gcp-backend.tf.bak"
content = local.backend_tf_appsupport
}