# 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

```text
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

1. 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.
2. If the docs show it as a nested block (no `=` in the example), drop the `=`:

   ```hcl
   # wrong: blue_green_update = { enabled = true }
   # right:
   blue_green_update {
     enabled = true
   }
   ```

3. 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_ids` with an `access` block), update your config to the new schema:

   ```hcl
   access {
     group_ids = [twingate_group.aws.id]
   }
   ```

4. Run `terraform validate`. Expected: `Success! The configuration is valid.`

## When this applies

- `validate` or `plan` fails 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 `variable` blocks, 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 `.terraform` by 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.