Terraform "Unsupported argument" in a resource or block in CI
Terraform validates every argument against the resource or provider schema. "Unsupported argument" means the name you set is not part of that schema, usually a typo or an argument removed or renamed in a newer provider version.
What this error means
validate or plan fails with "Error: Unsupported argument" and "An argument named ... is not expected here." at the line that sets it.
Error: Unsupported argument
on main.tf line 8, in resource "aws_instance" "web":
8: instance_typ = "t3.micro"
An argument named "instance_typ" is not expected here.Common causes
A typo or wrong argument name
The argument is misspelled or does not belong to this resource type, so the schema rejects it.
A provider upgrade removed or renamed the argument
CI resolved a newer provider where the argument was renamed, deprecated out, or moved into a nested block.
How to fix it
Match the argument to the provider schema
- Open the resource docs for the provider version CI resolved.
- Rename or remove the argument to match the current schema.
- Pin the provider version if you need the older argument shape.
resource "aws_instance" "web" {
instance_type = "t3.micro"
}Pin the provider that defines the argument
If an upgrade removed the argument, pin the provider to a version that still supports it while you migrate.
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.30"
}
}How to prevent it
- Pin provider versions so schemas do not shift under CI.
- Read the provider upgrade guide before bumping major versions.
- Run validate in CI to catch schema mismatches early.