Terraform v0.12.19
azurerm_app_service
resource "azurerm_app_service" "web" {
count = length(var.webapps)
name = "webappname"
location = "westeurope"
resource_group_name = azurerm_resource_group.web[0].name
app_service_plan_id = azurerm_app_service_plan.web[0].id
https_only = true
site_config {
default_documents = ["index.html"]
always_on = true
ip_restriction {
ip_address = "x.x.0.0/16" # redacted real ip
}
ip_restriction {
ip_address = "x:x:x::/44" # redacted real ip
}
}
}
ipv6 format should be accepted, since move to CIDR notation it doesn't. In 1.44.0 when subnet value was give it worked
(I've replaced actutal ip values with an x)
Error: site_config.0.ip_restriction.1.ip_address must start with IPV4 address and/or slash, number of bits (0-32) as prefix. Example: 127.0.0.1/8. Got "x:x:x::/44".
on ..\..\..\infra\terraform\global\web\main.tf line 44, in resource "azurerm_app_service" "web":
44: resource "azurerm_app_service" "web" {
terraform plannone
none
To add, a scenario like the below also fails but with a different error message:
dynamic "ip_restriction" {
for_each = var.ip6_cidr_blocks
content {
ip_address = ip_restriction.value
subnet_mask = null
virtual_network_subnet_id = null
}
}
var.ip6_cidr_blocks is defined as a list of IPv6 CIDR blocks.
Error: web.AppsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="IpSecurityRestriction.IpAddress is invalid. It must be in CIDR format." Details=[{"Message":"IpSecurityRestriction.IpAddress is invalid. It must be in CIDR format."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"51021","Message":"IpSecurityRestriction.IpAddress is invalid. It must be in CIDR format.","MessageTemplate":"{0} is invalid. {1}","Parameters":["IpSecurityRestriction.IpAddress","It must be in CIDR format."]}}]
Any update on this?
This has been released in version 2.31.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.31.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
Any update on this?