generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HCS-1716: Add HCP Consul federation support #68
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1f583ee
HCS-1716: Add HCP Consul federation support
riddhi89 0d72276
Fix case
riddhi89 c3c0fa9
Fix case 2
riddhi89 9e2d43c
Fix case 3
riddhi89 4a99ab2
Fix case 4
riddhi89 a1f6522
Update docs
riddhi89 8f81f84
Fix client call after rebase
riddhi89 6edd9a0
Fix rebase bug
riddhi89 5ae8671
Reduce create cluster params
riddhi89 713419d
Explicitly build the self_link instead of using tf resource id
riddhi89 77432a4
HCP Consul Cluster to HCP Consul cluster
riddhi89 862fe68
Update index.md and fix sentence in docs
riddhi89 8ad8ed0
Remove conditional for checking primary's org id
riddhi89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
subcategory: "" | ||
page_title: "Federate HCP Consul clusters - HCP Provider" | ||
description: |- | ||
An example of federating a new HCP Consul cluster with an existing one. | ||
--- | ||
|
||
# Federate a new HCP Consul cluster with an existing one | ||
|
||
Once you have a HCP Consul cluster, you can create a new Consul cluster to federate with the existing one. | ||
|
||
```terraform | ||
resource "hcp_hvn" "example" { | ||
hvn_id = var.hvn_id | ||
cloud_provider = var.cloud_provider | ||
region = var.region | ||
} | ||
|
||
resource "hcp_consul_cluster" "primary" { | ||
hvn_id = hcp_hvn.example.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 | ||
} | ||
``` |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
provider "hcp" {} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
resource "hcp_hvn" "example" { | ||
hvn_id = var.hvn_id | ||
cloud_provider = var.cloud_provider | ||
region = var.region | ||
} | ||
|
||
resource "hcp_consul_cluster" "primary" { | ||
hvn_id = hcp_hvn.example.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 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
variable "hvn_id" { | ||
description = "The ID of the HCP HVN." | ||
type = string | ||
} | ||
|
||
variable "cloud_provider" { | ||
description = "The cloud provider of the HCP HVN and Consul cluster." | ||
type = string | ||
} | ||
|
||
variable "region" { | ||
description = "The region of the HCP HVN and Consul cluster." | ||
type = string | ||
} | ||
|
||
variable "primary_cluster_id" { | ||
description = "The ID of the HCP Consul cluster which is the primary in the federation." | ||
type = string | ||
} | ||
|
||
variable "secondary_cluster_id" { | ||
description = "The ID of the HCP Consul cluster which is the secondary in the federation." | ||
type = string | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
resource "hcp_hvn" "example" { | ||
hvn_id = "hvn" | ||
cloud_provider = "aws" | ||
region = "us-west-2" | ||
cidr_block = "172.25.16.0/20" | ||
} | ||
|
||
resource "hcp_consul_cluster" "primary" { | ||
hvn_id = hcp_hvn.example.hvn_id | ||
cluster_id = "consul-cluster-primary" | ||
tier = "development" | ||
} | ||
|
||
resource "hcp_consul_cluster" "secondary" { | ||
hvn_id = hcp_hvn.example.hvn_id | ||
cluster_id = "consul-cluster-secondary" | ||
tier = "development" | ||
primary_link = hcp_consul_cluster.primary.self_link | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this update! Awkward timing with my tech debt chore in the sdk 😅