-
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
HCCP-91 HVN route resource and import #122
Conversation
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.
This looks good! Left a few comments sprinkled throughout - only major one about dropping the cidr block.
I'm hoping to do another test run tomorrow - accidentally kicked it off on my env with routes feature flag turned off. 🙈 Are acceptance tests planned for a follow-up? I can help with those, since we don't have any multi-provider test examples yet.
0b7d2a8
to
5d90b7c
Compare
de67601
to
e9c4555
Compare
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.
Looking good! I haven't gotten the chance to test this out locally but code all looks great. Just had some nitpicks on documentation.
Co-authored-by: Brenna Hewer-Darroch <[email protected]>
* added create, scaffolded read and delete for hvn route resource * Adds delete for HVN route resource * Adds hvn route import function * Handle both peering and tgw attachment resource types in HVN route resources * Regenerate docs, add example s for hvn route resource * Re-run go generate after adding example * ACreate hvn route function checks for target existence before proceeding * Add peering to example for hvn route, regenerate docs * Resolves comments - better logging and commenting for HVN route resource * removed unnecessary validation * removed todos * removed tgw attachment from hvn route example * added examples of the hvn route target * moved hvn route creation into clients * simplified parsing target_link for the hvn route resource * dropped checking for hvn route existance * fixed hvn routes import * gofmt hvn_route.go * redo hvn route import to use route ID * go mod tidy * redo hvn route datasource to use route ID * renamed hvn -> hvn_link * refactored WaitForHVNRouteToBeActive * unified hvn route errors/logs * small refactoring * improved logs * messages improvements Co-authored-by: Brenna Hewer-Darroch <[email protected]> * regenarated docs Co-authored-by: Anton Panferov <[email protected]> Co-authored-by: Brenna Hewer-Darroch <[email protected]>
* added create, scaffolded read and delete for hvn route resource * Adds delete for HVN route resource * Adds hvn route import function * Handle both peering and tgw attachment resource types in HVN route resources * Regenerate docs, add example s for hvn route resource * Re-run go generate after adding example * ACreate hvn route function checks for target existence before proceeding * Add peering to example for hvn route, regenerate docs * Resolves comments - better logging and commenting for HVN route resource * removed unnecessary validation * removed todos * removed tgw attachment from hvn route example * added examples of the hvn route target * moved hvn route creation into clients * simplified parsing target_link for the hvn route resource * dropped checking for hvn route existance * fixed hvn routes import * gofmt hvn_route.go * redo hvn route import to use route ID * go mod tidy * redo hvn route datasource to use route ID * renamed hvn -> hvn_link * refactored WaitForHVNRouteToBeActive * unified hvn route errors/logs * small refactoring * improved logs * messages improvements Co-authored-by: Brenna Hewer-Darroch <[email protected]> * regenarated docs Co-authored-by: Anton Panferov <[email protected]> Co-authored-by: Brenna Hewer-Darroch <[email protected]>
* added create, scaffolded read and delete for hvn route resource * Adds delete for HVN route resource * Adds hvn route import function * Handle both peering and tgw attachment resource types in HVN route resources * Regenerate docs, add example s for hvn route resource * Re-run go generate after adding example * ACreate hvn route function checks for target existence before proceeding * Add peering to example for hvn route, regenerate docs * Resolves comments - better logging and commenting for HVN route resource * removed unnecessary validation * removed todos * removed tgw attachment from hvn route example * added examples of the hvn route target * moved hvn route creation into clients * simplified parsing target_link for the hvn route resource * dropped checking for hvn route existance * fixed hvn routes import * gofmt hvn_route.go * redo hvn route import to use route ID * go mod tidy * redo hvn route datasource to use route ID * renamed hvn -> hvn_link * refactored WaitForHVNRouteToBeActive * unified hvn route errors/logs * small refactoring * improved logs * messages improvements Co-authored-by: Brenna Hewer-Darroch <[email protected]> * regenarated docs Co-authored-by: Anton Panferov <[email protected]> Co-authored-by: Brenna Hewer-Darroch <[email protected]>
* HCCP-91 HVN route resource (#122) * added create, scaffolded read and delete for hvn route resource * Adds delete for HVN route resource * Adds hvn route import function * Handle both peering and tgw attachment resource types in HVN route resources * Regenerate docs, add example s for hvn route resource * Re-run go generate after adding example * ACreate hvn route function checks for target existence before proceeding * Add peering to example for hvn route, regenerate docs * Resolves comments - better logging and commenting for HVN route resource * removed unnecessary validation * removed todos * removed tgw attachment from hvn route example * added examples of the hvn route target * moved hvn route creation into clients * simplified parsing target_link for the hvn route resource * dropped checking for hvn route existance * fixed hvn routes import * gofmt hvn_route.go * redo hvn route import to use route ID * go mod tidy * redo hvn route datasource to use route ID * renamed hvn -> hvn_link * refactored WaitForHVNRouteToBeActive * unified hvn route errors/logs * small refactoring * improved logs * messages improvements * regenarated docs * HCCP-138 breaking changes for Peering and TGW attachment (#128) * HCCP-138 required id and removed cidr from peering * HCCP-138 fixed tgw-attachment resource import * HCCP-138 removed cidrs from tgw-attachment * bonus: drop deleted guide example * update peering examples in guides * HVN route migration guide (#129) * add note to changelog * update readme * add hvn route migration guide * id -> ID * bonus: fix error typo * go gen * add context to HVN route intro * update link in banner to registry migration guide * update changelog * update version in examples * add warning banner to hvn route doc * added handling 404 when deleting hvn route (#137) * HCCP-184 acceptance tests for HVN route, TGW attachment and network peering (#130) * HCCP-184 added acceptance tests for HVN route resource * HCCP-184 added acceptance tests for TGW attachment resource * HCCP-184 added acceptance tests for network peering resource * HCCP-138 added clarification about AWS credentials * HCCP-184 renamed tgw attachment acceptance test resource * HCCP-184 improved tests doc * HCCP-184 fixed test after rebasing * added dedicated timeout for hvn route delete (#138) Co-authored-by: Ti Zhang <[email protected]> Co-authored-by: Anton Panferov <[email protected]> Co-authored-by: Brenna Hewer-Darroch <[email protected]>
[auto] Sync with Public Provider
Ticket: https://hashicorp.atlassian.net/browse/HCCP-91
Description
Adds the hcp_hvn_route resource and import. The implementation follows examples of the existing resources, with the exception of using
self_link
to refer to HVNs and Target resources, rather than the ID of the HVN or Target.A simple example of what the resource looks like for a TGW attachment:
A simple example of what the resource looks like for a peering:
To Test
The example included here can be used to test the functionality of this resource.
Please note that
Additional notes
This PR also makes the fieldspeer_vpc_cidr_block
anddestination_cidr
optional. This is an interim solution, as based on discussions with product we have reached consensus that we will make the breaking changes in the next release by simply removing these fields. However, for the purpose of this PR these fields need to be optional, otherwise submitting a value during creation of peering/tgw attachment will result in a route having been created for these resources, causing an error during later HVN route creationThis PR does not include acceptance tests, as they will be in a subsequent PR, along with the acceptance tests for TGW attachment resrouce
A follow-up PR will also remove
peer_vpc_cidr_block
anddestination_cidr
fields from the peering and TGW attachment resource, as aforementioned. It will also make the user-settable ID field required for both of these resrouces. It is not included in this PR as the provider team has agreed that it will make this review easier.