Skip to content
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

azurerm_virtual_hub_connection - support the routing block #8950

Merged
merged 6 commits into from
Nov 3, 2020

Conversation

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @neil-yechenwei

Thanks for this PR.

Taking a look through it appears the happy path is covered, but since we're missing update/removal test cases we're unable to confirm these work. As such can we look to add some more test cases and fix up the relevant bugs so that this can work?

Thanks!

},

"route_table_ids": {
Type: schema.TypeSet,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a route table, the ordering likely matters - so why is this a set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
ValidateFunc: azure.ValidateResourceID,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use more specific validation here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intend to use the validation of hub route table once PR 8939 is merged.


* `name` - (Optional) The name which should be used for this static_route.

* `address_prefixes` - (Optional) The list of all address prefixes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `address_prefixes` - (Optional) The list of all address prefixes.
* `address_prefixes` - (Optional) A list of CIDR Blocks (presumably?) which should be used [..].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


* `address_prefixes` - (Optional) The list of all address prefixes.

* `next_hop_ip_address` - (Optional) The ip address of the next hop.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `next_hop_ip_address` - (Optional) The ip address of the next hop.
* `next_hop_ip_address` - (Optional) The IP Address which should be used for the Next Hop [..].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


func flattenArmVirtualHubConnectionRoutingConfiguration(input *network.RoutingConfiguration) []interface{} {
if input == nil {
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be set to an empty list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


func expandArmVirtualHubConnectionVnetStaticRoute(input []interface{}) *network.VnetRoute {
if len(input) == 0 {
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so how is this cleared?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

testCheckAzureRMVirtualHubConnectionExists(data.ResourceName),
),
},
data.ImportStep(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need more tests here, this only just one create case, can we add multiple routes, updates, removing the route etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@neil-yechenwei
Copy link
Contributor Author

@tombuildsstuff , thanks for your comments. I've updated code by your comments. Please have a look. Thanks.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @neil-yechenwei, overall this looks good but i've left some comments inline that should be addressed before merge

@@ -76,6 +77,80 @@ func resourceArmVirtualHubConnection() *schema.Resource {
ForceNew: true,
Default: false,
},

"routing_configuration": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think we need configuration here?

Suggested change
"routing_configuration": {
"routing": {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

},
},

"vnet_static_route": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this make more sense as

Suggested change
"vnet_static_route": {
"static_vnet_route": {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


* `name` - (Optional) The name which should be used for this Static Route.

* `address_prefixes` - (Optional) A list of CIDR Blocks which should be used for Virtual Hub Connection.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we elaborate what an address prefix is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


* `labels` - (Optional) The list of labels to provide a mechanism to logically group route tables.

* `route_table_ids` - (Optional) A list of Route Table ID's which is used for Virtual Hub Connection.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammer

Suggested change
* `route_table_ids` - (Optional) A list of Route Table ID's which is used for Virtual Hub Connection.
* `route_table_ids` - (Optional) A list of Route Table ID's to associated with this Virtual Hub Connection.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


A `routing_configuration` block supports the following:

* `associated_route_table_id` - (Optional) The ID of route table associated with Virtual Hub connection.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammer

Suggested change
* `associated_route_table_id` - (Optional) The ID of route table associated with Virtual Hub connection.
* `associated_route_table_id` - (Optional) The ID of the route table associated with this Virtual Hub connection.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


A `propagated_route_table` block supports the following:

* `labels` - (Optional) The list of labels to provide a mechanism to logically group route tables.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `labels` - (Optional) The list of labels to provide a mechanism to logically group route tables.
* `labels` - (Optional) The list of labels to assign to this route table.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@neil-yechenwei
Copy link
Contributor Author

@katbyte , thanks for your comments. I've updated code. Please have a look. Thanks.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should still validate that the names are not emptyt?

@neil-yechenwei
Copy link
Contributor Author

@katbyte , sure, I added empty string validation.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @neil-yechenwei - this LGTM now 👍

@katbyte katbyte changed the title Add support for routingConfiguration of azurerm_virtual_hub_connection azurerm_virtual_hub_connection - support the routing block Nov 3, 2020
@katbyte katbyte merged commit 6c0d71b into hashicorp:master Nov 3, 2020
katbyte added a commit that referenced this pull request Nov 3, 2020
@ghost
Copy link

ghost commented Dec 4, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants