# Terraform: Error: Unsupported block type — Blocks of type "versioning" are not expected here

**Code:** `Unsupported block type: Blocks of type "x" are not expected here` · **Category:** Terraform · **Seen on:** Terraform

A nested block doesn't exist in that resource's schema (renamed, removed or misplaced).

## 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

1. Use the new resource/nested block per provider docs
2. Convert `block {}` to `attr = {}` (or reverse)
3. Pin the provider version you wrote the code for

## Detailed fix by platform

### Terraform

1. `resource "aws_s3_bucket_versioning" "v" { bucket = aws_s3_bucket.b.id versioning_configuration { status = "Enabled" } }`

## How to diagnose

1. **Block** — In schema?
2. **Provider** — Version split?
3. **Syntax** — Block vs attribute?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/unsupported-block-type)
