'Features block terraform

terraform init successfully initializes but gets stuck on terraform plan.

The error is related to the feature block. I'm unsure where to add the feature block:

Insufficient features blocks (source code not available) At least 1 "features" blocks are required.

My configuration looks like

terraform {
  required_version = ">= 0.11"

  backend "azurerm" {
    features {}
   }
 }

I tried removing and adding features block as github page



Solution 1:[1]

When you run updated version of terraform you need to define another block defined below

provider "azurerm" {
   features {}
}

Solution 2:[2]

An other reason for the message could be, that a named provider is in use:

provider "azurerm" {
  alias = "some_name" # <- here
  features {}
}

But not specified on the resource:

resource "azurerm_resource_group" "example" {
  # might this block is missing
  # -> provider = azurerm.some_name
  name     = var.rg_name
  location = var.region
}

Error message:

terraform plan
?
? Error: Insufficient features blocks
?
?   on <empty> line 0:
?   (source code not available)
?
? At least 1 "features" blocks are required.

Solution 3:[3]

Please check if highlighted lines are added to your template

Please check if highlighted lines are added to your template

Solution 4:[4]

In Terraform >= 0.13, here's what a sample versions.tf looks like (note the provider config being in a separate block):

# versions.tf
terraform {
  required_providers {
    azurerm = {
      # ...
    }
  }
  required_version = ">= 0.13"
}

# This block goes outside of the required_providers block!
provider "azurerm" {
  features {}
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Liam
Solution 2 Patrick
Solution 3 Your Dad
Solution 4 cody.codes