Registry / aws / cdk-aurora-globaldatabase

cdk-aurora-globaldatabase

JSON →
library2.4.74pypypi✓ verified 87d ago

cdk-aurora-globaldatabase is an AWS CDK construct library, currently at version 2.4.18, that simplifies the creation of cross-region AWS Aurora Global Databases. It provides high-level constructs to deploy Aurora clusters across different regions, manage replication, and handle failover scenarios, following the AWS CDK v2 best practices. The library's release cadence generally aligns with updates to the AWS CDK and underlying AWS Aurora features.

pip install cdk-aurora-globaldatabase
INSTALL
IMPORT
SIG · CDK-AURORA-GLOBALD
C
cdk-aurora-globaldatabase
awspythonv2.4.74
Install
18.1s avg
Import
—
Disk
397MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.4.74 · 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
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 359.3MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 18.1s · import 0.000s · 360MB
397MB installed
● package 397MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GlobalAuroraRDSMaster
✓ from cdk_aurora_globaldatabase import GlobalAuroraRDSMaster
✗ from cdk_aurora_globaldatabase import AuroraGlobalDatabase
GlobalAuroraRDSSlaveInfra
✓ from cdk_aurora_globaldatabase import GlobalAuroraRDSSlaveInfra
GlobalAuroraRDSMasterProps
✓ from cdk_aurora_globaldatabase import GlobalAuroraRDSMasterProps

This quickstart deploys an AWS Aurora Global Database with a MySQL-compatible engine across two AWS regions. It provisions a new VPC for the database. Before running, ensure your AWS account is bootstrapped for CDK in 'us-east-1' and 'us-east-2', and your `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` environment variables are set, or replace the placeholder values. The `synth` command generates the CloudFormation templates.

import os from aws_cdk import App, Stack, Environment from aws_cdk import aws_ec2 as ec2 from aws_cdk import aws_rds as rds from cdk_aurora_globaldatabase import AuroraGlobalDatabase class GlobalDatabaseStack(Stack): def __init__(self, scope: App, id: str, **kwargs) -> None: super().__init__(scope, id, **kwargs) # For a quickstart, we create a new VPC. In a production environment, # you would typically look up an existing VPC: # vpc = ec2.Vpc.from_lookup(self, "MyExistingVpc", vpc_name="YourVpcName") vpc = ec2.Vpc( self, "AuroraGlobalDbVpc", max_azs=2, # Deploy resources across 2 availability zones cidr="10.0.0.0/16", enable_dns_hostnames=True, enable_dns_support=True ) AuroraGlobalDatabase( self, "MyAuroraGlobalDatabase", primary_region="us-east-1", secondary_regions=["us-east-2"], # Add more regions as needed aurora_version=rds.AuroraMysqlEngineVersion.VER_3_06_0, # Example MySQL version vpc=vpc, # Optional: specify instance type, credentials, storage encryption, etc. # instance_type=ec2.InstanceType.of(ec2.InstanceClass.R6G, ec2.InstanceSize.LARGE), # credentials=rds.Credentials.from_generated_secret("auroraglobaladmin"), # encryption_key=kms.Key(self, "AuroraKey") ) app = App() # Define an environment for the primary stack primary_env = Environment( account=os.environ.get('CDK_DEFAULT_ACCOUNT', '123456789012'), region=os.environ.get('CDK_DEFAULT_REGION', 'us-east-1') ) GlobalDatabaseStack(app, "AuroraGlobalDbStack", env=primary_env) app.synth()
Debug
Known issues
breakingThis library is built specifically for AWS CDK v2. Attempting to use it with an AWS CDK v1 project will result in `ModuleNotFoundError` for `aws_cdk` or `constructs` (v1 vs v2 imports) or incompatible API usage.
fix
Migrate your CDK project to AWS CDK v2 by installing `aws-cdk-lib` and `constructs>=10.0.0`. If you must use CDK v1, look for a v1-compatible version of this construct or implement it manually.
affects: 2.x.x (when used with AWS CDK v1)
gotchaDeploying an Aurora Global Database across multiple regions requires your AWS environment to be bootstrapped in *all* specified regions (primary and all secondaries).
fix
Before deploying, run `cdk bootstrap aws://YOUR_ACCOUNT_ID/PRIMARY_REGION` and `cdk bootstrap aws://YOUR_ACCOUNT_ID/SECONDARY_REGION` for every region involved in your global database. Replace `YOUR_ACCOUNT_ID` and region placeholders with your actual AWS account ID and region names.
affects: All versions
gotchaAWS credentials must be configured for all regions specified in `primary_region` and `secondary_regions`. CDK will attempt to deploy resources in each of these regions.
fix
Ensure your AWS CLI or SDK configuration (e.g., `~/.aws/credentials` file, environment variables like `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`) provides valid credentials for all regions where the global database will be deployed. This often means having a profile configured for each region or using global credentials with appropriate permissions.
affects: All versions
Upgrade
Version history
2.4.74latest on PyPI · released Jun 13, 2026
Audit
Dependencies
aws-cdk-librequiredCore AWS CDK constructs required for deployment, this library is built on CDK v2.
constructsrequiredCDK's fundamental construct library dependency, version >=10.0.0 for CDK v2.
pythonrequiredRequires Python 3.9 or higher.
Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources