-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Author(s)
Roger Zhang (@crogerc) - zxiaogon@amazon.com
Summary
Add support for AWS China regions (Beijing and Ningxia) to enable deployment of the Multi-Provider Generative AI Gateway in the AWS China partition (aws-cn).
Motivation
AWS China regions are operated independently by local partners (Sinnet for Beijing, NWCD for Ningxia) and constitute a separate partition from global AWS regions. This creates several key differences:
- Separate partition: Uses
aws-cnpartition instead ofaws, requiring different ARN formats - Independent account system: Requires separate AWS China accounts and credentials
- Regulatory compliance: Subject to Chinese data sovereignty and ICP filing requirements
- Service availability: Some AWS services may have different availability
- Market demand: Many Chinese enterprises and organizations require data to remain within China borders
Currently, this project only supports global AWS regions, preventing Chinese customers from deploying this solution to meet their compliance and data residency requirements.
Proposal
Extend the project to support AWS China regions by adding region-specific configurations and updating deployment scripts to handle the China partition.
User Experience
Users deploying in AWS China regions will:
- Use the same deployment process as global regions
- Have deployments that respect China partition ARN formats
- Receive clear documentation about how to connect Global BedRock endpoint
- Receive clear documentation about China-specific requirements (ICP filing, etc.)
Technical Implementation
1. Create Region-Specific Configuration Files
Add two new configuration files following the existing pattern:
config/default-config-cn-north-1.yaml(Beijing region)config/default-config-cn-northwest-1.yaml(Ningxia region)
These files should include:
- Available Amazon Bedrock models in China regions
- Proper model naming conventions for China partition
- Any region-specific model configurations
2. Update Deployment Scripts
Modify deploy.sh to:
- Detect China regions (cn-north-1, cn-northwest-1)
- Handle
aws-cnpartition in ARN construction - Adjust service endpoints for China partition where necessary
- Ensure proper region detection logic
3. Update Terraform Configurations
Update litellm-terraform-stack and related Terraform modules to:
- Support
aws-cnpartition ARN formats - Handle China-specific service endpoints
- Ensure all used AWS services are available in China regions
- Add appropriate provider configurations for China partition
4. Verify Service Availability
Confirm the following services are available and properly configured in China regions:
- Amazon ECS / Amazon EKS
- Amazon RDS
- Amazon ElastiCache (Redis)
- Application Load Balancer
- Amazon CloudFront (note: different behavior in China)
- AWS WAF
- AWS Certificate Manager
- Amazon S3
- AWS Secrets Manager
5. Update Documentation
- Add cn-north-1 and cn-northwest-1 to the "Supported AWS Regions" table in README.md
- Document China-specific requirements and considerations
- Add notes about ICP filing requirements for public-facing deployments
- Document any service limitations or differences in China regions
Alternatives Considered
Alternative 1: Separate Fork for China
Create a separate fork specifically for China regions.
- Pros: Complete independence, easier to customize
- Cons: Maintenance burden, fragmentation, duplicate effort
Alternative 2: Manual Configuration
Let users manually adapt configurations for China.
- Pros: No code changes needed
- Cons: Poor user experience, error-prone, not scalable
Alternative 3: Current Approach (Recommended)
Integrate China support into the main project.
- Pros: Unified codebase, better maintenance, consistent experience
- Cons: Slightly increased complexity
Benefits
- Market Expansion: Enables Chinese customers to use this solution
- Compliance: Helps organizations meet Chinese data residency requirements
- Completeness: Demonstrates comprehensive AWS global coverage
- Community: Attracts Chinese developer community contributions
- Best Practice: Shows proper multi-partition AWS architecture
Drawbacks
- Testing Complexity: Requires AWS China account for proper testing
- Maintenance: Need to track China-specific service updates
- Documentation: Additional documentation for China-specific requirements
- Limited Access: Not all contributors may have access to AWS China for testing
Required Resources
- Development Time: Estimated 2-3 days for implementation
- Testing: Access to AWS China account (cn-north-1 or cn-northwest-1)
- Documentation: 1 day for comprehensive documentation updates
- Review: Maintainer time for code review and validation
Dependencies
- Access to AWS China account for testing and validation
- Knowledge of available Bedrock models in China regions
- Understanding of China partition ARN format differences
- Familiarity with ICP and Chinese compliance requirements (for documentation)
Testing Plan
- Unit Testing: Verify configuration file syntax and structure
- Integration Testing:
- Deploy to cn-north-1 region
- Deploy to cn-northwest-1 region
- Test all core features (model access, authentication, logging, etc.)
- Validation:
- Verify Bedrock model access
- Test ECS/EKS deployment
- Confirm proper ARN handling
- Validate CloudWatch logging
- Test S3 log bucket creation
Rollout Plan
- Phase 1: Create configuration files and update deployment scripts
- Phase 2: Test in development environment with AWS China account
- Phase 3: Update documentation with China-specific guidance
- Phase 4: Submit PR for review
- Phase 5: Address feedback and merge
- Phase 6: Announce China region support in release notes
Documentation
Required documentation updates:
- README.md:
- Add cn-north-1 and cn-northwest-1 to supported regions table
- Add "AWS China Regions" section with special considerations
- Deployment Guide:
- Document China-specific deployment steps
- Explain ICP filing requirements for public deployments
- Note any service limitations
- Configuration Guide:
- Explain partition-specific configurations
Additional Notes
I am willing to contribute this feature and can:
- Create the necessary configuration files
- Update deployment scripts
- Test in AWS China regions (if I have access)
- Write comprehensive documentation
- Respond to code review feedback
Please let me know if this enhancement aligns with the project's roadmap and if there are any specific requirements or preferences for the implementation.