Install & Compatibility
Where this runs
tested against v2.259.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 23.3MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 2.4s · import 0.000s · 24MB
22MB installed
● package 22MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RegionInfo
✓ from aws_cdk import region_info
# ...
info = region_info.RegionInfo.get("us-east-1")
✗ from aws_cdk.region_info import RegionInfo # Not the standard import pattern in Python CDK
The standard Python CDK import convention is to import the module and access classes via the module alias.
Fact
✓ from aws_cdk import region_info
# ...
endpoint = region_info.Fact.find("ap-northeast-1", region_info.FactName.S3_STATIC_WEBSITE_ENDPOINT)
✗ from aws_cdk.region_info.Fact import find # Incorrect submodule access
Accessing Fact and FactName directly via the main region_info module is the idiomatic way.
This quickstart demonstrates how to retrieve standard region information using `RegionInfo.get()` and its attributes, as well as how to use `Fact.find()` for specific facts. It also includes an example of how to register custom region facts for new or overridden data.
import os
from aws_cdk import region_info
# Get information for a specific region
us_east_1_info = region_info.RegionInfo.get("us-east-1")
print(f"S3 Static Website Endpoint for us-east-1: {us_east_1_info.s3_static_website_endpoint}")
# Get a service principal for a region
s3_service_principal = us_east_1_info.service_principal("s3.amazonaws.com")
print(f"S3 Service Principal for us-east-1: {s3_service_principal}")
# Find a specific fact for a region using Fact.find()
# Example: Get the domain suffix for a China region
cn_north_1_domain_suffix = region_info.Fact.find("cn-north-1", region_info.FactName.DOMAIN_SUFFIX)
print(f"Domain Suffix for cn-north-1: {cn_north_1_domain_suffix}")
# Override or add a custom fact (e.g., for a new or hypothetical region)
# This is for demonstration; normally you'd implement IFact
class MyCustomFact:
def __init__(self, region, name, value):
self.region = region
self.name = name
self.value = value
@region_info.jsii.implements(region_info.IFact)
class CustomEndpointFact(MyCustomFact):
pass
custom_region = "bermuda-triangle-1"
custom_endpoint_fact = CustomEndpointFact(
region=custom_region,
name=region_info.FactName.S3_STATIC_WEBSITE_ENDPOINT,
value="s3-website.bermuda-triangle-1.nowhere.com"
)
region_info.Fact.register(custom_endpoint_fact)
# Retrieve the custom fact
retrieved_custom_endpoint = region_info.RegionInfo.get(custom_region).s3_static_website_endpoint
print(f"Custom S3 Static Website Endpoint for {custom_region}: {retrieved_custom_endpoint}")
Debug
Known issues
breakingSpecific versions of `aws-cdk-region-info` (e.g., 2.200.1 up to 2.232.2) have experienced a regression causing a `Cannot find module 'aws-cdk-lib/core/lib/errors'` error at runtime due to internal dependency issues within the CDK ecosystem. This can completely block CDK application execution.fixDowngrade `aws-cdk-region-info` to a known working version (e.g., 2.199.0) or upgrade to a patched version that resolves the internal module resolution issue. Always test upgrades in a controlled environment.
affects: 2.200.1 - 2.232.2 (and potentially others within this range)
gotchaThe AWS CDK CLI (e.g., `cdk synth`, `cdk deploy`) overrides any user-set `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` environment variables. If you rely on these for specific deployments, the CLI's behavior might lead to unintended targets.fixInstead of `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION`, define your own custom environment variables (e.g., `MY_DEPLOY_ACCOUNT`, `MY_DEPLOY_REGION`) and use them programmatically within your CDK application for stack `env` properties. For region-specific resource lookups or imports, explicitly specify the `env` property in your CDK stacks.
affects: All AWS CDK v2 versions
gotchaWhile `aws-cdk-region-info` aims to be comprehensive, new AWS regions or very specific service endpoints might initially be missing or have outdated facts. Relying solely on the built-in data might lead to `None` values or incorrect behavior for bleeding-edge features or newly launched regions.fixIf you encounter missing or incorrect data, you can temporarily override or supply new facts using `region_info.Fact.register()`. It's also recommended to report such findings as a GitHub issue to the AWS CDK team so it can be fixed in future releases.
affects: All versions, particularly for newly launched AWS regions or services.
Errors
Common errors & fixes
Error: Cannot find module 'aws-cdk-lib/core/lib/errors'
An internal dependency resolution issue within specific versions of `aws-cdk-region-info` prevents it from finding a required module from `aws-cdk-lib/core`.
fixCheck your `aws-cdk-region-info` version. If it's within the affected range (e.g., 2.200.1 - 2.232.2), try downgrading to a stable preceding version (e.g., 2.199.0) or upgrading to a version released after the fix was applied.
cdk synth / cdk deploy uses the wrong AWS account or region for deployment.
The AWS CDK CLI overwrites `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` if set as shell environment variables. Additionally, 'environment-agnostic' stacks might default to your AWS CLI's configured profile.
fixAvoid using `CDK_DEFAULT_ACCOUNT` or `CDK_DEFAULT_REGION` directly. Instead, explicitly define the `env` property (account and region) for your CDK `Stack` instances in your code. For custom overrides, define and use your own environment variables (e.g., `MY_ACCOUNT`, `MY_REGION`) within your application code.
region_info.RegionInfo.get('some-new-region').some_fact returns None or incorrect value.
The built-in database of regional facts might not yet include information for very new AWS regions or specific, recently launched service features, or might contain outdated information.
fixVerify the fact's existence and correctness in the official AWS documentation. If missing or incorrect, use `region_info.Fact.register()` to programmatically inject or override the specific fact for your application. Consider contributing the correction to the AWS CDK project via a GitHub issue.
Upgrade
Version history
2.259.0latest on PyPI · released Jun 12, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.9 or higher for AWS CDK v2 compatibility.