generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auto peering for Consul Federation (#154)
* update to hcp-sdk-go 0.10.0 * add auto_hvn_to_hvn_peering * update docs * add test * add to datasource as well * update notes * comment on when peering happens * update guide * remove unused example * update docs * add docs * riddhis feedback * Update templates/resources/consul_cluster.md.tmpl Co-authored-by: Brenna Hewer-Darroch <[email protected]> * Update templates/guides/consul-federation.md.tmpl Co-authored-by: Brenna Hewer-Darroch <[email protected]> * fix docs Co-authored-by: Brenna Hewer-Darroch <[email protected]>
- Loading branch information
1 parent
7f8b8cd
commit e476502
Showing
13 changed files
with
87 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,40 @@ | ||
--- | ||
subcategory: "" | ||
page_title: "Federate HCP Consul clusters - HCP Provider" | ||
page_title: "Federation with Auto HVN Peering - HCP Provider" | ||
description: |- | ||
An example of federating a new HCP Consul cluster with an existing one. | ||
An example of federating a new HCP Consul cluster with an existing one via auto peering. | ||
--- | ||
|
||
# Federate a new HCP Consul cluster with an existing one | ||
# Federation with Auto HVN Peering | ||
|
||
Once you have a HCP Consul cluster, you can create a new Consul cluster to federate with the existing one. | ||
By providing `auto_hvn_to_hvn_peering` as a parameter on the secondary cluster, the HVNs are being peered | ||
automatically ensuring full connectivity. This parameter only ever has to be provided on secondary clusters. | ||
|
||
```terraform | ||
resource "hcp_hvn" "example" { | ||
hvn_id = var.hvn_id | ||
resource "hcp_hvn" "primary" { | ||
hvn_id = var.primary_hvn_id | ||
cloud_provider = var.cloud_provider | ||
region = var.region | ||
region = var.primary_region | ||
} | ||
resource "hcp_hvn" "secondary" { | ||
hvn_id = var.secondary_hvn_id | ||
cloud_provider = var.cloud_provider | ||
region = var.secondary_region | ||
} | ||
resource "hcp_consul_cluster" "primary" { | ||
hvn_id = hcp_hvn.example.hvn_id | ||
hvn_id = hcp_hvn.primary.hvn_id | ||
cluster_id = var.primary_cluster_id | ||
tier = "development" | ||
} | ||
resource "hcp_consul_cluster" "secondary" { | ||
hvn_id = hcp_hvn.example.hvn_id | ||
cluster_id = var.secondary_cluster_id | ||
tier = "development" | ||
primary_link = hcp_consul_cluster.primary.self_link | ||
hvn_id = hcp_hvn.secondary.hvn_id | ||
cluster_id = var.secondary_cluster_id | ||
tier = "development" | ||
primary_link = hcp_consul_cluster.primary.self_link | ||
auto_hvn_to_hvn_peering = true | ||
} | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
resource "hcp_hvn" "example" { | ||
hvn_id = var.hvn_id | ||
resource "hcp_hvn" "primary" { | ||
hvn_id = var.primary_hvn_id | ||
cloud_provider = var.cloud_provider | ||
region = var.region | ||
region = var.primary_region | ||
} | ||
|
||
resource "hcp_hvn" "secondary" { | ||
hvn_id = var.secondary_hvn_id | ||
cloud_provider = var.cloud_provider | ||
region = var.secondary_region | ||
} | ||
|
||
resource "hcp_consul_cluster" "primary" { | ||
hvn_id = hcp_hvn.example.hvn_id | ||
hvn_id = hcp_hvn.primary.hvn_id | ||
cluster_id = var.primary_cluster_id | ||
tier = "development" | ||
} | ||
|
||
resource "hcp_consul_cluster" "secondary" { | ||
hvn_id = hcp_hvn.example.hvn_id | ||
cluster_id = var.secondary_cluster_id | ||
tier = "development" | ||
primary_link = hcp_consul_cluster.primary.self_link | ||
hvn_id = hcp_hvn.secondary.hvn_id | ||
cluster_id = var.secondary_cluster_id | ||
tier = "development" | ||
primary_link = hcp_consul_cluster.primary.self_link | ||
auto_hvn_to_hvn_peering = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
--- | ||
subcategory: "" | ||
page_title: "Federate HCP Consul clusters - HCP Provider" | ||
page_title: "Federation with Auto HVN Peering - HCP Provider" | ||
description: |- | ||
An example of federating a new HCP Consul cluster with an existing one. | ||
An example of federating a new HCP Consul cluster with an existing one via auto peering. | ||
--- | ||
|
||
# Federate a new HCP Consul cluster with an existing one | ||
# Federation with Auto HVN Peering | ||
|
||
Once you have a HCP Consul cluster, you can create a new Consul cluster to federate with the existing one. | ||
By providing `auto_hvn_to_hvn_peering` as a parameter on the secondary cluster, the HVNs are being peered | ||
automatically ensuring full connectivity. This parameter only ever has to be provided on secondary clusters. | ||
|
||
{{ tffile "examples/guides/consul_cluster_federation/main.tf" }} | ||
{{ tffile "examples/guides/consul_cluster_federation/main.tf" }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters