Terraform "Unsupported block type" in CI
A configuration uses a nested block the schema does not recognize. The block name is wrong, or a provider/module upgrade turned that block into an argument (or moved it).
What this error means
validate/plan fails with "Unsupported block type", saying blocks of that type are not expected. It commonly follows a provider upgrade where a nested block was renamed, removed, or converted to an attribute.
Error: Unsupported block type
on main.tf line 10, in resource "aws_instance" "web":
10: credit_specification {
Blocks of type "credit_specification" are not expected here.Common causes
Block renamed, removed, or converted
A newer provider/module version renamed the nested block, removed it, or replaced it with an argument - so the old block is no longer valid.
Wrong block name or placement
A typo in the block name, or nesting a block where the schema expects it elsewhere, triggers "Unsupported block type".
How to fix it
Use the block/argument the schema expects
Check the provider/module docs for the version you run and use the correct nested block or attribute form.
# check the docs for your provider version, e.g.
resource "aws_instance" "web" {
credit_specification {
cpu_credits = "standard"
}
}Reconcile after upgrades
- Read the provider/module changelog for changed nested blocks.
- Convert removed blocks to their new argument/block form.
- Run
terraform validateto confirm the structure is accepted.
How to prevent it
- Review provider/module upgrade notes for block schema changes.
- Pin provider and module versions to keep schemas stable.
- Run
terraform validatein CI to catch unsupported blocks early.