How to fix Error: null_resource.provisioner not supported in Terraform

TerraformINTERMEDIATEMEDIUMUpdated Dec 31, 2025ยท 113 views

The null_resource with provisioners is deprecated in modern Terraform. Upgrade to Terraform 1.4+ and use terraform_data instead, or migrate to native provider features for better reliability and maintainability.

Quick fix

Fixes Error: null_resource.provisioner not supported

terraform version
  1. Check your Terraform version
  2. Replace null_resource with terraform_data
  3. Remove the null provider requirement
  4. Reinitialize your Terraform working directory
terraform โ€” error
terraform version
Error: null_resource.provisioner not supported

What this error means

The "null_resource.provisioner not supported" error occurs when you're using an older pattern in Terraform that relies on the null provider's null_resource to run provisioners. This error typically appears in Terraform 1.4 or later, where HashiCorp has transitioned to a built-in terraform_data resource that replaces null_resource. The null_resource was originally created as a workaround to execute provisioners without managing real infrastructure. However, HashiCorp moved away from this pattern and introduced terraform_data as a built-in, maintained replacement. The error indicates that your configuration uses the deprecated null_resource, which may not be fully supported in your current Terraform version or environment. This change is part of HashiCorp's broader initiative to discourage provisioners in favor of more reliable alternatives like cloud-native features, external tools, or configuration management systems.

Typical symptoms

  • Error message states "null_resource.provisioner not supported"
  • terraform plan or apply fails with provisioner-related errors
  • Code works with older Terraform versions but fails on 1.4+
  • Provisioner blocks are not recognized on null_resource

Common causes

  1. Using null_resource from the null provider in Terraform 1.4 or later
  2. The null provider is not installed or updated in your environment
  3. Migration from an older Terraform version without updating resource types
  4. Mixing deprecated null_resource with modern Terraform versions

How to fix "Error: null_resource.provisioner not supported"

1Check your Terraform version

First, verify which version of Terraform you're running:

bash
terraform version

If you're on Terraform 1.4 or later, null_resource is deprecated in favor of terraform_data. Ensure your version is fully up to date.

2Replace null_resource with terraform_data

Convert your null_resource blocks to terraform_data. The syntax is nearly identical, with two key changes:
- Change resource "null_resource" to resource "terraform_data"
- Change the trigger argument from triggers to triggers_replace

Before (deprecated):

hcl
resource "null_resource" "example" {
  triggers = {
    instance_id = aws_instance.web.id
  }

  provisioner "local-exec" {
    command = "echo 'Instance created'"
  }
}

After (current best practice):

hcl
resource "terraform_data" "example" {
  triggers_replace = aws_instance.web.id

  provisioner "local-exec" {
    command = "echo 'Instance created'"
  }
}
3Remove the null provider requirement

Since terraform_data is built into Terraform, you no longer need to require the null provider. Remove or update your required_providers block:

Remove this:

hcl
terraform {
  required_providers {
    null = {
      source  = "hashicorp/null"
      version = "~> 3.0"
    }
  }
}

The terraform_data resource uses the built-in terraform provider, which is always available.

4Reinitialize your Terraform working directory

After updating your configuration, reinitialize to apply the changes:

bash
terraform init

This will remove the null provider from your lock file and state if it's no longer referenced.

5Validate and plan your changes

Verify that your updated configuration is valid and plan your changes:

bash
terraform validate
terraform plan

Review the plan to ensure Terraform recognizes your terraform_data resources correctly and doesn't attempt to destroy and recreate your infrastructure.

6Consider alternatives to provisioners

Before applying, consider whether provisioners are necessary. HashiCorp recommends exhausting alternatives first:

- AWS: Use user_data scripts, Systems Manager Run Command, or CloudFormation templates
- Azure: Use Custom Script Extension or Azure Automation
- GCP: Use startup scripts or Cloud Build
- General: Use cloud-init, Ansible, Chef, or other configuration management tools

Provisioners are inherently less reliable than native cloud features and should be a last resort.

Advanced notes

Destroy-time Provisioners: Destroy provisioners only run if the resource block remains in your configuration at destroy time. If you remove a resource with a destroy provisioner entirely, the provisioner won't execute. Plan your resource lifecycle accordingly.

terraform_data Limitations: terraform_data is lightweight and stateless. It doesn't authenticate with cloud providers or manage infrastructure. It exists purely for running provisioners and storing trigger-based state transitions. If you need actual resource management, use provider-specific resources instead.

Migration from Older Versions: If upgrading from Terraform 0.12 or earlier, the transition is straightforward. The main difference is the resource name and trigger argument. State migration typically happens automatically during terraform init.

Why Provisioners Are Discouraged: Provisioners run outside Terraform's normal provider plugins and lack proper error handling, retry logic, and idempotency guarantees. They're difficult to debug and often hide infrastructure configuration in scripts. Use them only when no native alternative exists.

Frequently asked questions

What does "Error: null_resource.provisioner not supported" mean?
provisioner not supported" error occurs when you're using an older pattern in Terraform that relies on the null provider's null_resource to run provisioners. 4 or later, where HashiCorp has transitioned to a built-in terraform_data resource that replaces null_resource. The null_resource was originally created as a workaround to execute provisioners without managing real infrastructure.
How do I fix "Error: null_resource.provisioner not supported"?
The null_resource with provisioners is deprecated in modern Terraform. Upgrade to Terraform 1.4+ and use terraform_data instead, or migrate to native provider features for better reliability and maintainability.
What causes "Error: null_resource.provisioner not supported"?
Using null_resource from the null provider in Terraform 1.4 or later The null provider is not installed or updated in your environment Migration from an older Terraform version without updating resource types
Is the "Error: null_resource.provisioner not supported" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading