diff --git a/agents.tf b/agents.tf index b279e0e..d9870c7 100644 --- a/agents.tf +++ b/agents.tf @@ -8,7 +8,7 @@ module "agents" { for_each = local.agent_nodepools - name = "${each.value.nodepool_name}-${random_pet.agents[each.key].id}" + name = "${each.value.nodepool_name}-${random_pet.cluster.id}-${random_pet.agents[each.key].id}" ssh_keys = [hcloud_ssh_key.k3s.id] public_key = var.public_key private_key = var.private_key diff --git a/control_planes.tf b/control_planes.tf index adccd05..0472a45 100644 --- a/control_planes.tf +++ b/control_planes.tf @@ -7,7 +7,7 @@ module "control_planes" { source = "./modules/host" count = var.control_plane_count - name = "control-plane-${random_pet.control_planes[count.index].id}" + name = "control-plane-${random_pet.cluster.id}-${random_pet.control_planes[count.index].id}" ssh_keys = [hcloud_ssh_key.k3s.id] public_key = var.public_key diff --git a/main.tf b/main.tf index b42ff77..fa0da53 100644 --- a/main.tf +++ b/main.tf @@ -1,5 +1,5 @@ resource "random_pet" "cluster" { - length = 2 + length = 1 } resource "random_password" "k3s_token" {