-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate_docs.tf
33 lines (31 loc) · 1.21 KB
/
generate_docs.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
locals {
node_pool_docs = templatefile(
"${path.module}/extra_resources/docs/node_pools.md.tmpl",
{
gcp_project = var.gcp_project
gke_location = google_container_cluster.polyaxon_cluster.location
disk_type_experiments = var.disk_type_experiments
disk_size_gb_experiments = var.disk_size_gb_experiments
# See the output of cpu_experiments_node_pool module
regular_cpu_node_pools = module.regular_cpu_node_pools.node_pools
preemptible_cpu_node_pools = module.preemptible_cpu_node_pools.node_pools
# See the output of gpu_experiments_node_pool module
regular_gpu_node_pools = module.regular_gpu_node_pools.node_pools
preemptible_gpu_node_pools = module.preemptible_gpu_node_pools.node_pools
}
)
}
# Generate a document about node pools.
#
# NOTE:
# Generating documents with terraform might not be appropriate,
# but it is an easy way to get information about node pools and their labels.
resource "null_resource" "generate_node_pools_docs" {
# Run this every time.
triggers = {
always_run = timestamp()
}
provisioner "local-exec" {
command = "echo '${local.node_pool_docs}' > ${path.cwd}/node_pools.md"
}
}