Terraform: Error: Unsupported block type — Blocks of type "versioning" are not expected here
A nested block doesn't exist in that resource's schema (renamed, removed or misplaced).
Error: Unsupported block typeBlocks of type "versioning" are not expected hereError: Unsupported block type Blocks of type "lifecycle_rule" are not expected hereBlocks of type "x" are not expected here. Did you mean "y"?Error: Unsupported block type: Blocks of type Meaning
Same causes as unsupported arguments. With AWS provider 4+, many S3 settings (versioning, lifecycle, logging, acl) became separate resources (aws_s3_bucket_versioning). Check whether it should be an argument (attr = {}) instead of a block, and block nesting.
Common causes
- Block removed/renamed in newer provider
- Should be an attribute object not a block
- Wrong nesting level
- Typo
- Dynamic block syntax needed
⚡ Quick fix
- Use the new resource/nested block per provider docs
- Convert
block {}toattr = {}(or reverse) - Pin the provider version you wrote the code for
Detailed fix by platform
Terraform
resource "aws_s3_bucket_versioning" "v" { bucket = aws_s3_bucket.b.id versioning_configuration { status = "Enabled" } }
How to diagnose
- Block — In schema?
- Provider — Version split?
- Syntax — Block vs attribute?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Duplicate resource configuration / variable declaration Terraform: Error: Duplicate resource "aws_s3_bucket" configuration — A aws_s3_bucket resource named "logs" was already declared at main.tf:1
- Failed to query available provider packages Terraform: Error: Failed to query available provider packages — Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints
- Invalid AWS Region Terraform: Error: Invalid AWS Region: us-east-3 / Error: configuring Terraform AWS Provider: validating provider credentials: operation error STS: GetCallerIdentity
Most viewed in Terraform
- Error acquiring the state lock Terraform: Error: Error acquiring the state lock — ConditionalCheckFailedException / state blob is already locked
- Inconsistent dependency lock file Terraform: Error: Inconsistent dependency lock file — provider x: required by this configuration but no version is selected
- Reference to undeclared resource Terraform: Error: Reference to undeclared resource / Reference to undeclared input variable
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026