## TL;DR

You ran Terraform in a directory that has no `.tf` files. Nothing is broken; you are just in the wrong folder. `cd` into the directory that holds your configuration and run the command again.

## The error

```text
Error: No configuration files
Apply requires configuration to be present.
```

## Steps to fix

1. Check where you are: `pwd` and `ls *.tf`.
   - Expected: no `.tf` files listed, confirming the diagnosis.
2. Move to the configuration directory:
   ```bash
   cd terraform
   ```
   (use your actual config path)
   - Expected: `ls *.tf` now lists your configuration files.
3. Re-run the command (`terraform plan`, `terraform apply`, ...).
   - Expected: Terraform loads the configuration instead of erroring.

## When to use this

- Any Terraform command fails instantly with `No configuration files`, typically after cloning a repo, in CI with a wrong `working-directory`, or in a monorepo where the config lives in a subfolder.

## When NOT to use this

- `Backend initialization required` means config was found but init is missing. In CI, prefer setting the job's working directory over `cd` in scripts.

## Compatibility

- All Terraform versions; the check is unchanged.

## Root cause

Terraform only reads configuration from the current working directory (plus `-chdir`). An empty directory, the repo root of a monorepo, or a CI checkout at the wrong path contains no `.tf` files, so there is nothing to plan or apply.

## Edge cases

- Hidden gotcha: `.tf` files that are all commented out still count as present; this error is strictly about missing files.
- `terraform -chdir=path plan` lets you stay put and point at the config directory.
- In CI, a stale `working-directory` after a repo restructure is the usual culprit; fix the workflow, not the repo.