# Error: Build 'amazon-ebs' errored: error validating regions: MissingEndpoint

## TL;DR
The AWS SDK cannot resolve an endpoint for the region. Check the `region` value is valid and that no custom `endpoint` override is misconfigured; then rebuild.

## The error

```
Build 'amazon-ebs' errored after 844 microseconds: error validating regions: MissingEndpoint: 'Endpoint' configuration is required for this service
```

## Fix it

1. Verify `region` is a real AWS region string (e.g. `us-east-1`), not empty or a placeholder.
   - Success check: the value matches the AWS region list.
2. If you set a custom `endpoint` (for LocalStack, VPC endpoints, or other S3-compatible targets), confirm it is a complete URL including scheme.
   - Success check: the endpoint parses as a URL.
3. Remove any stale `AWS_ENDPOINT_URL` or shared-config endpoint overrides leaking into the build environment.
   - Success check: `env | grep -i endpoint` shows nothing unexpected.
4. Re-run `packer build`.
   - Success check: the build gets past region validation.

## When to use this
You hit this within milliseconds of build start, before any instance or AMI activity.

## When NOT to use this
Do not use this for `Unknown region` (baked-in region list) or credential errors. This is specifically endpoint resolution.

## Compatibility
Packer 1.x, amazon builders, AWS SDK endpoint resolution.

## Variants
- `MissingEndpoint` on other AWS services Packer calls (EC2, SSM)
- The error appearing only in certain environments (env var leakage)

## Root cause
The SDK builds service endpoints from the region plus any overrides. An empty region, a bad override, or a conflicting env var leaves it with no endpoint to call.

## Edge cases
- The 844-microsecond timing is the tell: this fails before any network I/O, so it is configuration, not connectivity.
- GovCloud/China partitions need the right partition endpoints; a standard-region config fails there.
