mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-05-23 17:23:00 +00:00
GCP quotas are fairly limited (on my account, I can only use 8 public IP addresses per zone, which means that I cannot deploy many public clusters in a single zone). I tried to use private clusters, but that causes other problems. This refactoring makes it possible to spread clusters across multiple zones. Since I have access to 20+ zones in Europe and 20+ zones in the US, this lets me create a lot of public clusters and simplifies the module quite a bit.
20 lines
433 B
HCL
20 lines
433 B
HCL
resource "random_string" "_" {
|
|
length = 4
|
|
number = false
|
|
special = false
|
|
upper = false
|
|
}
|
|
|
|
resource "time_static" "_" {}
|
|
|
|
locals {
|
|
timestamp = formatdate("YYYY-MM-DD-hh-mm", time_static._.rfc3339)
|
|
tag = random_string._.result
|
|
# Common tags to be assigned to all resources
|
|
common_tags = [
|
|
"created-by-terraform",
|
|
format("created-at-%s", local.timestamp),
|
|
format("created-for-%s", local.tag)
|
|
]
|
|
}
|