Error: Unsupported argument
Fixes terraform's "Error: Unsupported argument" (an argument named X is not expected here). Use when validate or plan rejects an argument on a resource, provider, or module call, usually after a provider upgrade, a typo, or using = on something that is a nested block. Covers block-vs-argument confusion and removed-argument migrations. Not for Unsupported block type or Missing required argument.
Fix terraform "Error: Unsupported argument"
TL;DR: You used an argument name the resource or module does not recognize. Check the exact name against the provider docs for your pinned version. Nine times out of ten it is a typo, a version mismatch (argument added or removed in a newer provider), or a = that should not be there because the thing is a block, not an argument.
The error
Error: Unsupported argument
on main.tf line 104, in resource "twingate_resource" "demo_resource":
104: group_ids = var.demo_resource_group_ids
An argument named "group_ids" is not expected here.Steps
- Open the provider docs for the exact resource and the exact provider version you pinned. Confirm the argument exists there, spelled exactly as you wrote it. Expected: you spot the mismatch.
If the docs show it as a nested block (no
=in the example), drop the=:# wrong: blue_green_update = { enabled = true } # right: blue_green_update { enabled = true }If the argument was removed or renamed in a newer provider version (very common on major bumps, e.g. twingate v1.0.0 replaced
group_idswith anaccessblock), update your config to the new schema:access { group_ids = [twingate_group.aws.id] }- Run
terraform validate. Expected:Success! The configuration is valid.
When this applies
validateorplanfails naming an argument "not expected here" on a resource, data source, provider, or module call.- You just upgraded a provider version.
When it does NOT apply
- The error is
Unsupported block type(a block where none is allowed). Different fix: remove or relocate the block. - The error is
Missing required argument. That is the inverse; add the named argument. - Module call arguments: those must match the module's declared
variableblocks, not the resource's arguments.
Tool and version compatibility
- Terraform CLI 0.12+ through 1.x. Schema comes from the provider, so behavior depends on the provider version pinned in
required_providers.
Why it happens
Providers declare a fixed schema per resource. Anything outside it is rejected at validation. The usual triggers: copying config written for a different provider major version, typos, or treating a nested block as an argument with =.
Edge cases and pitfalls
- Deprecated arguments sometimes linger for versions then get removed. Pin provider versions and read the changelog before bumping majors.
- If the error appears in
.terraform/modules/..., the problem is inside a third-party module. Pin the module version or open an issue upstream; do not edit files under.terraformby hand. - LocalStack's tflocal generates an override file built for AWS provider 4.x schemas; using it with provider 5.x throws this error for renamed fields. Regenerate or drop the override.