Skip to content

Terraform plan error: resource type not found

Quick summary

Your Terraform config references an unknown resource type — the provider does not recognize it.

Why this happens

  • The resource type name is misspelled or does not exist in the provider

  • The required provider is not declared in the configuration or is not installed

  • The provider version does not support the resource type being used

Minimal example

✗ Broken code
resource "aws_s3_buckettt" "my_bucket" { # typo: buckettt instead of bucket
  bucket = "my-bucket"
}
✓ Fixed code
resource "aws_s3_bucket" "my_bucket" { # correct resource type
  bucket = "my-bucket"
}

Correcting the resource type name to aws_s3_bucket matches the AWS provider's documentation and the plan succeeds.

How to diagnose

  • Run terraform plan to see the error message with the unknown resource type

  • Check the provider documentation for valid resource types and their names

  • Verify the provider is declared in the required_providers block and the version supports the resource

How to fix

  • Correct the resource type name to match the provider's documentation

  • Add the required provider to the required_providers block in the configuration

  • Upgrade the provider to a version that supports the resource type

How to prevent

  • Use terraform validate and a Terraform linter in CI to catch errors before applying

  • Keep provider versions pinned and refer to the matching documentation

Related Resources

Related Lessons

← Back to language