You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please enter the module version that you are using:
source = "Azure/lz-vending/azurerm"
version = "4.1.5"
Description
When importing virtual network peerings the following error message is returned for the imported vnet:
│ Error: Invalid configuration
│
│ with module.landing_zones["subscription-name.yaml"].module.lz_vending.module.virtualnetwork[0].azapi_resource.vnet["vnet-appgw-test"],
│ on .terraform\modules\landing_zones.lz_vending\modules\virtualnetwork\main.tf line 37, in resource "azapi_resource" "vnet":
│ 37: resource "azapi_resource" "vnet" {
│
│ embedded schema validation failed: the argument "body" is invalid:
│ `properties.subnets.0.properties.applicationGatewayIPConfigurations` is not expected here. Do you mean
│ `properties.subnets.0.properties.applicationGatewayIpConfigurations`?
│ `properties.virtualNetworkPeerings.0.properties.peerCompleteVnets` is not expected here. Do you mean
│ `properties.virtualNetworkPeerings.0.properties.peeringState`?
│ You can try to update `azapi` provider to the latest version or disable the validation using the feature flag `schema_validation_enabled = false` within the resource block
This seems to be because the virtualnetwork module is using old API versions. If I update the virtualNetworks version in the module source in the .terraform directory like this:
Create import statements for an existing vnet. E.g.
import {
id = "/subscriptions/xxxx/resourceGroups/tst_rg/providers/Microsoft.Network/virtualNetworks/TSTNET-01"
to = module.landing_zones["subscription-name.yaml"].module.lz_vending.module.virtualnetwork[0].azapi_resource.vnet["TSTNET-01"]
}
This is an issue with the provider I think, rather than the module. I think the import statement uses the latest api version, which may be different from the resource config.
Community Note
Versions
Please paste the output of
terraform version
command from within the initialized directory:Please enter the module version that you are using:
Description
When importing virtual network peerings the following error message is returned for the imported vnet:
This seems to be because the virtualnetwork module is using old API versions. If I update the virtualNetworks version in the module source in the .terraform directory like this:
Then the error disappears.
Steps to Reproduce
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: