kubernetes/kops · error
error Zone is not a recognized AZ: %q (check you have specif
Error message
error Zone is not a recognized AZ: %q (check you have specified a valid zone?)
What it means
Returned by ValidateZones (aws_cloud.go:1827) when a zone supplied by the user is not present in the AZ list returned by DescribeAvailabilityZones for the region. The error lists the known zones in the log to help the user correct the value.
Source
Thrown at upup/pkg/fi/cloudup/awsup/aws_cloud.go:1827
return err
}
zoneMap := make(map[string]ec2types.AvailabilityZone)
for _, z := range azs {
name := aws.ToString(z.ZoneName)
zoneMap[name] = z
}
for _, zone := range zones {
z, ok := zoneMap[zone]
if !ok {
var knownZones []string
for z := range zoneMap {
knownZones = append(knownZones, z)
}
klog.Infof("Known zones: %q", strings.Join(knownZones, ","))
return fmt.Errorf("error Zone is not a recognized AZ: %q (check you have specified a valid zone?)", zone)
}
for _, message := range z.Messages {
klog.Warningf("Zone %q has message: %q", zone, aws.ToString(message.Message))
}
if z.State != ec2types.AvailabilityZoneStateAvailable {
klog.Warningf("Zone %q has state %q", zone, z.State)
}
}
return nil
}
func (c *awsCloudImplementation) DNS() (dnsprovider.Interface, error) {
provider, err := dnsprovider.GetDnsProvider(dnsproviderroute53.ProviderName, nil)
if err != nil {
return nil, fmt.Errorf("error building (k8s) DNS provider: %v", err)View on GitHub (pinned to 4c8573c808)
Solutions
- Compare against known zones logged with the error, or run `aws ec2 describe-availability-zones --region <region>` and pick valid zone names
- Fix typos in --zones / cluster spec zone names
- Enable opt-in region AZs in the AWS console if the zone exists but is not opted in
- Confirm the zone belongs to the same region the kops client is configured for
Example fix
// before kops create cluster --zones us-east-1f # not present for this account // after kops create cluster --zones us-east-1a,us-east-1b,us-east-1c
Defensive patterns
Strategy: validation
Validate before calling
// Validate zones against the region's AZs before invoking kops
out, err := ec2Client.DescribeAvailabilityZones(ctx, &ec2.DescribeAvailabilityZonesInput{AllAvailabilityZones: aws.Bool(true)})
valid := map[string]bool{}
for _, z := range out.AvailabilityZones { valid[aws.ToString(z.ZoneName)] = *z.State == "available" }
for _, zone := range requestedZones {
if !valid[zone] { return fmt.Errorf("zone %q is not an available AZ in this account/region", zone) }
} Prevention
- Copy zone names from `aws ec2 describe-availability-zones` output, not documentation
- Remember AZ availability is account-specific — a coworker's zone list may not match yours
- Enable opt-in AZs in the console when targeting opt-in regions
- Keep zones and the kops region consistent
When it happens
Trigger: A zone string in the cluster spec (e.g. from --zones) is not among the region's returned AvailabilityZones, or the AZ entry has State other than available / opt-in not enabled.
Common situations: Typo like `us-east-1d` when the account lacks that AZ (AZs are account-specific); using a Local Zone or Outpost zone ID where a region AZ name is expected; using zones in a region different from the cluster region; new opt-in region AZs not enabled on the account.
Related errors
- error querying for valid AZs in %q - verify your AWS credent
- instance type %q not found in region %q
- instance type %q not found in region %q
- DIGITALOCEAN_ACCESS_TOKEN is required
- timed out waiting for volume to detach
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/6b636b77bfc5d050.
Report an issue: GitHub.