# Terraform: Error: Missing required argument — The argument "ami" is required, but no definition was found

**Code:** `Missing required argument` · **Category:** Terraform · **Seen on:** Terraform

A resource/module block lacks an argument the schema requires.

## Meaning

Add the required argument (the message names it), or if it's a module input add the variable. Remember provider-level required arguments can come from environment variables (AWS_REGION) only for some. For nested blocks: "Insufficient `x` blocks" means a required block count isn't met.

## Common causes

- Argument omitted
- Module variable has no default and wasn't passed
- Required nested block missing (`Insufficient`)
- Conditional logic leaving it unset
- Provider version made an optional argument required

## Quick fix

1. Add the argument shown
2. Pass the module variable or add a default
3. Check the provider docs for required arguments

## Detailed fix by platform

### Terraform

1. `terraform validate` lists all missing arguments

## How to diagnose

1. **Argument** — Which?
2. **Module** — Variable passed?
3. **Provider** — Version change?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/missing-required-argument)
