zed-industries/zed · error · anyhow::Error

Unsupported Region

Error message

Unsupported Region {region}

What it means

Bedrock model ids must be rewritten into per-region inference profile prefixes (`us.`, `eu.`, `global.`, `apac.`, `jp.`, `au.`, `us-gov.`, ...). This code buckets the configured AWS region by prefix (us-gov-, us-, sa-, ca-, eu-, specific ap- regions, ap-, me-); any region outside those buckets has no inference profile group and bails. Note the check runs before the `Custom` early-return, so even custom models fail on unsupported regions.

Solutions

  1. Switch the Bedrock region setting to one the mapping covers (any us-/sa-/ca-/eu-/me-/ap- region, plus the special-cased ap-southeast-2/4 and ap-northeast-1/3).
  2. Fix typos: verify the region string against `aws configure list` / your AWS config.
  3. If you must use an unmapped region, update Zed — newer releases extend this mapping; or contribute the region group upstream.
  4. As a code-level guard, validate the region against the recognized prefixes before constructing the model id.

Example fix

// before: unmapped region aborts id construction
let model_id = model.converse_model_id("af-south-1", allow_global)?; // Unsupported Region af-south-1

// after: validate the region bucket up front
const SUPPORTED_PREFIXES: [&str; 6] = ["us-gov-", "us-", "sa-", "ca-", "eu-", "me-"];
let region_group_ok = SUPPORTED_PREFIXES.iter().any(|p| region.starts_with(p))
    || region.starts_with("ap-");
anyhow::ensure!(region_group_ok, "region {region} has no Bedrock inference profile group; use a supported region");
let model_id = model.converse_model_id(region, allow_global)?;
Defensive patterns

Strategy: validation

Validate before calling

// Validate the region bucket before any converse_model_id call
fn region_has_profile_group(region: &str) -> bool {
    region.starts_with("us-gov-") || region.starts_with("us-") || region.starts_with("sa-")
        || region.starts_with("ca-") || region.starts_with("eu-")
        || region == "ap-southeast-2" || region == "ap-southeast-4"
        || region == "ap-northeast-1" || region == "ap-northeast-3"
        || region.starts_with("ap-") || region.starts_with("me-")
}
anyhow::ensure!(region_has_profile_group(region), "region {region} unsupported for Bedrock inference profiles");

Type guard

fn supported_bedrock_region(region: &str) -> bool {
    // true when the region maps to an inference-profile group (see validation snippet)
    region_has_profile_group(region)
}

Try / catch

match model.converse_model_id(region, allow_global) {
    Err(err) if err.to_string().contains("Unsupported Region") => {
        return Err(anyhow!("{err:#}; switch to a us-/eu-/ap-/me-/sa-/ca- region or update Zed"));
    }
    result => result?,
}

Prevention

When it happens

Trigger: Configuring Zed's Bedrock provider with a region outside the recognized buckets: `cn-north-1`/`cn-northwest-1` (China partitions), `af-south-1` (Africa), `il-central-1` (Israel), `mx-central-1`, or any typo'd region string like `use-east-1`. The `converse_model_id`/profile rewrite path then fails before any AWS call is made.

Common situations: Users on Bedrock China partition regions; newer AWS regions (af-, il-, mx-) added after this mapping was written; typos or wrong partitions (`aws-cn` vs `aws`) in credentials/config; company-mandated region not in the mapping.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/c3cc1ee12f0d1f29. Report an issue: GitHub.

Appendix: source

Thrown at crates/bedrock/src/models.rs:735

                "global"
            } else {
                "au"
            }
        } else if region == "ap-northeast-1" || region == "ap-northeast-3" {
            // Japan
            if allow_global && supports_global {
                "global"
            } else {
                "jp"
            }
        } else if region.starts_with("ap-") || region.starts_with("me-") {
            if allow_global && supports_global {
                "global"
            } else {
                "apac"
            }
        } else {
            anyhow::bail!("Unsupported Region {region}");
        };

        match (self, region_group) {
            (Self::Custom { .. }, _) => Ok(model_id.into()),

            // Global inference profiles
            (
                Self::ClaudeFable5
                | Self::ClaudeOpus5
                | Self::ClaudeOpus4_8
                | Self::ClaudeOpus4_7
                | Self::ClaudeOpus4_6
                | Self::ClaudeOpus4_5
                | Self::ClaudeSonnet5
                | Self::ClaudeSonnet4_6
                | Self::ClaudeSonnet4_5
                | Self::ClaudeSonnet4
                | Self::ClaudeHaiku4_5

View on GitHub (pinned to f4178619ac)