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
HCPE-1198: add CIDR guidance to HVN resource documentation #160
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
39277f1
add cidr guidance to HVN resource documentation
bcmdarroch 62d5281
add guidance about allowed address space
bcmdarroch a777676
add guidance on using first IP address of block
bcmdarroch 5c63372
rearrange order to place overlap rules after
bcmdarroch 571bb38
bonus: remove migration banner
bcmdarroch 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
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,34 @@ | ||
--- | ||
page_title: "{{.Type}} {{.Name}} - {{.ProviderName}}" | ||
subcategory: "" | ||
description: |- | ||
{{ .Description | plainmarkdown | trimspace | prefixlines " " }} | ||
--- | ||
|
||
# {{.Type}} ({{.Name}}) | ||
|
||
{{ .Description | trimspace }} | ||
|
||
We recommend the following when selecting the CIDR block of an HVN: | ||
|
||
- The CIDR block value must be a private IPv4 CIDR block within the [RFC1918](https://datatracker.ietf.org/doc/html/rfc1918) address space (10.*.*.*, 192.168.*.*, 172.[16-31].*.*). | ||
|
||
- The CIDR block value must be the first IP address of the desired CIDR block. The helper `cidrsubnet("172.16.1.1/24", 0, 0)` will specify the first address of the CIDR block in the first argument. | ||
|
||
- The CIDR block value must end between /16 and /25. | ||
|
||
- If the CIDR block values for your HVN and VPCs overlap, then you will not be able to establish a connection. Ensure that any VPCs you plan to connect do not have overlapping values. | ||
|
||
- The default HVN CIDR block value does not overlap with the default CIDR block value for AWS VPCs (172.31.0.0/16). However, if you are planning to use this HVN in production, we recommend adding a custom value instead of using the default. | ||
|
||
## Example Usage | ||
|
||
{{ tffile "examples/resources/hcp_hvn/resource.tf" }} | ||
|
||
{{ .SchemaMarkdown | trimspace }} | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
{{ codefile "shell" "examples/resources/hcp_hvn/import.sh" }} |
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.
One other thing since we're adding some more guidance here (although definitely not blocking): I believe our APIs expect CIDR blocks to use the first IP address in the block, and will error if an arbitrary IP address within the block is used (and I think
cidrsubnet()
can help with this?). We could potentially add something to help guide users past that restriction.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.
Oh I didn't know that.💡 I'll run this by control plane team:
The CIDR block value should be the first IP address of the desired CIDR block. The [cidrsubnet()](https://www.terraform.io/docs/language/functions/cidrsubnet.html) helper can be used to specify the first address.
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.
Got 👍 from control plane. Went ahead and added a couple more rules that we're enforcing on the backend.