{"record":{"id":"6b636b77bfc5d050","repo":"kubernetes/kops","slug":"error-zone-is-not-a-recognized-az-q-check-you-h","errorCode":null,"errorMessage":"error Zone is not a recognized AZ: %q (check you have specified a valid zone?)","messagePattern":"error Zone is not a recognized AZ: %q \\(check you have specified a valid zone\\?\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awsup/aws_cloud.go","lineNumber":1827,"sourceCode":"\t\treturn err\n\t}\n\n\tzoneMap := make(map[string]ec2types.AvailabilityZone)\n\tfor _, z := range azs {\n\t\tname := aws.ToString(z.ZoneName)\n\t\tzoneMap[name] = z\n\t}\n\n\tfor _, zone := range zones {\n\t\tz, ok := zoneMap[zone]\n\t\tif !ok {\n\t\t\tvar knownZones []string\n\t\t\tfor z := range zoneMap {\n\t\t\t\tknownZones = append(knownZones, z)\n\t\t\t}\n\n\t\t\tklog.Infof(\"Known zones: %q\", strings.Join(knownZones, \",\"))\n\t\t\treturn fmt.Errorf(\"error Zone is not a recognized AZ: %q (check you have specified a valid zone?)\", zone)\n\t\t}\n\n\t\tfor _, message := range z.Messages {\n\t\t\tklog.Warningf(\"Zone %q has message: %q\", zone, aws.ToString(message.Message))\n\t\t}\n\n\t\tif z.State != ec2types.AvailabilityZoneStateAvailable {\n\t\t\tklog.Warningf(\"Zone %q has state %q\", zone, z.State)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (c *awsCloudImplementation) DNS() (dnsprovider.Interface, error) {\n\tprovider, err := dnsprovider.GetDnsProvider(dnsproviderroute53.ProviderName, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building (k8s) DNS provider: %v\", err)","sourceCodeStart":1809,"sourceCodeEnd":1845,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/aws_cloud.go#L1809-L1845","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nkops create cluster --zones us-east-1f   # not present for this account\n// after\nkops create cluster --zones us-east-1a,us-east-1b,us-east-1c","handlingStrategy":"validation","validationCode":"// Validate zones against the region's AZs before invoking kops\nout, err := ec2Client.DescribeAvailabilityZones(ctx, &ec2.DescribeAvailabilityZonesInput{AllAvailabilityZones: aws.Bool(true)})\nvalid := map[string]bool{}\nfor _, z := range out.AvailabilityZones { valid[aws.ToString(z.ZoneName)] = *z.State == \"available\" }\nfor _, zone := range requestedZones {\n\tif !valid[zone] { return fmt.Errorf(\"zone %q is not an available AZ in this account/region\", zone) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["aws","ec2","availability-zones","validation"],"backgroundTag":"invalid-availability-zone","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}