Terraform v0.12.21
azurerm_v1.44.0_x4If you create a route which includes a slash character in its name, the API call gets corrupted.
resource "azurerm_route" "example_route" {
+ address_prefix = "10.255.16.24/32"
+ id = (known after apply)
+ name = "10.255.16.24/32"
+ next_hop_in_ip_address = "192.168.2.44"
+ next_hop_type = "VirtualAppliance"
+ resource_group_name = "example"
+ route_table_name = "example"
}
Error: Error Creating/Updating Route "10.255.16.24/32" (Route Table "example" / Resource Group "example"): network.RoutesClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="Failed" Message="The async operation failed." AdditionalInfo=[{"Message":"No HTTP resource was found that matches the request URI 'https://westeurope.network.azure.com:30071/redacted/redacted/subscriptions/redacted/resourceGroups/example/providers/Microsoft.Network/routeTables/main/routes/10.255.16.24/32?api-version=2019-09-01'."}]
If the name attribute is used, it should be safely URL encoded.
Due to missing encoding, the attribute name could lead to wrong URL components (e.g. a slash in its value is interpreted as path separator. Maybe that could be an injection issue, too.
OK, I'll fix this. Found out that there's a validation rule which should be used.
(The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.)
Alright, tests have passed. Please get back to me if there's something to improve @tombuildsstuff :-)
This has been released in version 2.7.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:
provider "azurerm" {
version = "~> 2.7.0"
}
# ... other configuration ...
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 👉 [email protected]. Thanks!
Most helpful comment
This has been released in version 2.7.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: