# Error: Unknown region: ap-northeast-2 (packer validate)

## TL;DR
Your Packer version predates the AWS region you are targeting. Upgrade Packer (and the amazon plugin) to a release that knows the region, then re-validate.

## The error

```
Build 'amazon-ebs' prepare failure: 1 error(s) occurred:

* Unknown region: ap-northeast-2
```

## Fix it

1. Check your Packer version: `packer version`. If it predates the region's launch, that is the problem.
   - Success check: you have a version number to compare against the region launch date.
2. Upgrade Packer to current, and upgrade the amazon plugin: `packer plugins install github.com/hashicorp/amazon`.
   - Success check: `packer version` shows the new release.
3. Re-run `packer validate`.
   - Success check: the region is accepted.
4. If you cannot upgrade, verify the region string is spelled correctly (`ap-northeast-2`, not `ap-north-east-2`) as a sanity check.
   - Success check: the spelling matches the AWS region list.

## When to use this
You hit this on `packer validate` with a region that AWS launched after your Packer release.

## When NOT to use this
Do not use this for `error validating regions: MissingEndpoint`. That is an endpoint configuration problem, not an unknown region.

## Compatibility
Older Packer 1.x and the amazon plugin. Current releases know all commercial regions.

## Variants
- `Unknown region: [any newer region]` (af-south-1, eu-south-1, me-south-1, etc. on old builds)
- The same error from `packer build` at prepare time, not just validate

## Root cause
Packer validated regions against a baked-in list. New AWS regions launched after the release were rejected as unknown until the list was updated upstream.

## Edge cases
- GovCloud and China regions have always needed explicit endpoint configuration; they fail differently.
- A typo'd region fails the same way on any version. Rule out typos before upgrading.
