Cluster Peering can be used to create connections between two or more independent clusters so that services deployed to different partitions or datacenters can communicate.
The cluster_peering_token
resource can be used to generate a peering token that can later be used to establish a peering connection.
The functionality described here is available only in Consul version 1.13.0 and later.
resource "consul_peering_token" "token" {
peer_name = "eu-cluster"
}
peer_name
(String) The name assigned to the peer cluster. The peer_name
is used to reference the peer cluster in service discovery queries and configuration entries such as service-intentions
. This field must be a valid DNS hostname label.meta
(Map of String) Specifies KV metadata to associate with the peering. This parameter is not required and does not directly impact the cluster peering process.partition
(String)id
(String) The ID of this resource.peering_token
(String, Sensitive) The generated peering token