Closed tomowatt closed 3 months ago
This provides an initial fix for: https://github.com/buildkite/terraform-provider-buildkite/issues/553
Manual testing with the following setup:
resource "buildkite_cluster" "primary" {
name = "Primary cluster"
description = "Runs the monolith build and deploy"
}
resource "buildkite_cluster" "secondary" {
name = "Secondary cluster"
description = "Runs the 2nd monolith build and deploy"
}
resource "buildkite_cluster_queue" "default" {
cluster_id = buildkite_cluster.primary.id
key = "default"
}
resource "buildkite_cluster_default_queue" "primary" {
cluster_id = buildkite_cluster.primary.id
queue_id = buildkite_cluster_queue.default.id
}
resource "buildkite_cluster_agent_token" "default" {
description = "Default cluster token"
cluster_id = buildkite_cluster.primary.id
}
Then switching cluster_id = buildkite_cluster.primary.id
to cluster_id = buildkite_cluster.secondary.id
which then causes them to be recreated as the Cluster Queue and Agent Token cannot be moved between Clusters.
Agent Tokens and (Default) Queues cannot be moved between Clusters so any attempt via Terraform should force the Resources to be replaced if the Cluster ID changes.