Problem
Plan/apply runs failing with the error above.
Error
Error: Insufficient features blocks
Cause
- Below are 2 scenarios when the error can be seen:
Scenario 1:features {}
is missing in the provider block
provider "azurerm" {
subscription_id = "XXX"
tenant_id = "XXX"
}
Correct syntax with features {}
included :
provider "azurerm" {
features {}
subscription_id = "XXX"
tenant_id = "XXX"
}
Scenario 2:
There is also another possibility to hit the same error with having the features block included in all provider blocks. It can happen if:
- Using only provider aliases without a default provider.
- There is resource that do not reference alias provider.
Failing configuration
provider "azurerm" {
alias = "test1"
features {}
subscription_id = "XXX"
tenant_id = "XXX"
}
provider "azurerm" {
alias = "test2"
features {}
subscription_id = "XXX"
tenant_id = "XXX"
}
resource "azurerm_resource_group" "example" {
name = "example-cdn-frontdoor"
location = "West Europe"
}
Solutions
-
Solution 1
Create a default provider:
provider "azurerm" {
features {}
subscription_id = "XXX"
tenant_id = "XXX"
}
-
Solution 2
All resources in the configuration should have the provider argument referencing an alias provider from example above:
resource "azurerm_resource_group" "example" {
provider = azurerm.test1
name = "example-cdn-frontdoor"
location = "West Europe"
}
Outcome
Terraform runs should not fail with Error: Insufficient features blocks.
Additional Information
- Provider configuration
- If issue persists please reach out Hashicorp support team