-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
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.
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, |
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.
since this is a route table, the ordering likely matters - so why is this a set?
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.
updated
Computed: true, | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
ValidateFunc: azure.ValidateResourceID, |
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.
we can use more specific validation here
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.
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. |
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.
* `address_prefixes` - (Optional) The list of all address prefixes. | |
* `address_prefixes` - (Optional) A list of CIDR Blocks (presumably?) which should be used [..]. |
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.
updated
|
||
* `address_prefixes` - (Optional) The list of all address prefixes. | ||
|
||
* `next_hop_ip_address` - (Optional) The ip address of the next hop. |
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.
* `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 [..]. |
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.
updated
|
||
func flattenArmVirtualHubConnectionRoutingConfiguration(input *network.RoutingConfiguration) []interface{} { | ||
if input == nil { | ||
return nil |
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 needs to be set to an empty list
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.
updated
|
||
func expandArmVirtualHubConnectionVnetStaticRoute(input []interface{}) *network.VnetRoute { | ||
if len(input) == 0 { | ||
return nil |
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.
so how is this cleared?
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.
updated
testCheckAzureRMVirtualHubConnectionExists(data.ResourceName), | ||
), | ||
}, | ||
data.ImportStep(), |
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.
we need more tests here, this only just one create case, can we add multiple routes, updates, removing the route etc?
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.
updated
@tombuildsstuff , thanks for your comments. I've updated code by your comments. Please have a look. Thanks. |
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 @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": { |
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.
i don't think we need configuration here?
"routing_configuration": { | |
"routing": { |
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.
updated
}, | ||
}, | ||
|
||
"vnet_static_route": { |
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.
would this make more sense as
"vnet_static_route": { | |
"static_vnet_route": { |
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.
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. |
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.
could we elaborate what an address prefix is?
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.
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. |
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.
grammer
* `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. |
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.
updated
|
||
A `routing_configuration` block supports the following: | ||
|
||
* `associated_route_table_id` - (Optional) The ID of route table associated with Virtual Hub connection. |
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.
grammer
* `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. |
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.
updated
|
||
A `propagated_route_table` block supports the following: | ||
|
||
* `labels` - (Optional) The list of labels to provide a mechanism to logically group route tables. |
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.
* `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. |
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.
updated
@katbyte , thanks for your comments. I've updated code. Please have a look. Thanks. |
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.
We should still validate that the names are not emptyt?
@katbyte , sure, I added empty string validation. |
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 @neil-yechenwei - this LGTM now 👍
routing
block
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! |
API Spec: https://docs.microsoft.com/en-us/rest/api/virtualwan/hubvirtualnetworkconnections/createorupdate#routingconfiguration