hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.59k stars 4.63k forks source link

Support for Azure Route Server #11705

Open JeffGiroux opened 3 years ago

JeffGiroux commented 3 years ago

Community Note

Description

Request support for Azure route server. Reference article below which is recent from March 2021. Says Route Server still in preview. What is usual GA-ready time for terraform provider code once the CSP releases a feature? Does feature need to be in GA before terraform provider code is started? Curious on both and also estimated time frames. Thx

https://docs.microsoft.com/en-us/azure/route-server/overview

New or Affected Resource(s)

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

JeffGiroux commented 3 years ago

Based on quick search, maybe this code is already implemented. In scanning an ARM template example, I see a couple resource types which match the terraform provider.

https://docs.microsoft.com/en-us/azure/route-server/quickstart-configure-template

"type": "Microsoft.Network/virtualHubs" "type": "Microsoft.Network/virtualHubs/ipConfigurations" "type": "Microsoft.Network/virtualHubs/bgpConnections"

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_hub https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_hub_ip https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_hub_bgp_connection

Is this the right set of resources?

I also noticed that not all fields are exportable. For example, only ID is an attribute in some of the above resources. I'm looking to obtain the ASN and peer IPs of the Azure Route Server similar to how you can run a CLI or powershell command (or view it in Azure portal).

Example powershell Get-AzRouteServer -RouterServerName myRouteServer -ResourceGroupName RouteServerRG

RouteServerAsn : 65515
RouteServerIps : {10.5.10.4, 10.5.10.5}
SlothCroissant commented 3 years ago

It does seem that this is the correct set of resources - though it's odd that they still live under Virtual WAN in Azure's REST swagger, so not entirely sure what's up.

I'm fairly certain at this point you can't create a Route Server via REST API alone (we have Virtual Router (which was renamed to Route Server early in preview).

Not sure if all this behavior will change by GA, also - that's the other asterisk, that we're still in preview so things could certainly change.

kyle8979 commented 2 years ago

Almost a year since the original post, Route Server is now GA for some time, where's the resource type in TF?? Im gonna have to call an ARM template from my TF code. Kind of embarassing.

SlothCroissant commented 2 years ago

I can't say for sure (haven't tried), but it does appear that people have gotten this working as a Virtual Hub (which is what Route Server is under the hood): https://discuss.hashicorp.com/t/support-of-route-server/22235/3

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_hub

I can try sometime and report back.

kyle8979 commented 2 years ago

OMG, thats the weirdest thing I've ever seen. It seems to have worked. Thanks for the pointer @SlothCroissant !

JeffGiroux commented 2 years ago

Here’s my example I created in the past year. Though I have not updated since Route Server became GA. Worked great.

https://github.com/JeffGiroux/f5_terraform/tree/main/Azure/Route_Server