moto icon indicating copy to clipboard operation
moto copied to clipboard

Partitions: Backends of all global services are now partitioned

Open bblommers opened this issue 1 year ago • 1 comments

Related to #7699

Regional services have their data stored in a BackendDict[ACCOUNT_ID][REGION] Global services (like S3) would use a magic global key instead: BackendDict[ACCOUNT_ID]["global"]

These services are not truly global though - data in the regular AWS partition is separate from the data in the AWS China/AWS GOV/etc partitions. This PR changes all references to the magic global to use the partition name instead: BackendDict[ACCOUNT_ID][aws|aws-cn|aws-gov|etc]

Existing users will sometimes import backends manually, and also refer to BackendDict[ACCOUNT_ID]["global"]. This will now resolve to BackendDict[ACCOUNT_ID]["aws"] for backwards compatibility.

The Moto API still uses a single global backend. Operations in the Moto API either call a specific service, or deal with configuration issues - there is no point in partitioning either.

bblommers avatar May 20 '24 11:05 bblommers

Codecov Report

Attention: Patch coverage is 98.36957% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 94.33%. Comparing base (303a6dd) to head (88d70c4).

Files Patch % Lines
moto/moto_proxy/proxy3.py 0.00% 2 Missing :warning:
moto/iam/models.py 96.87% 1 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7710   +/-   ##
=======================================
  Coverage   94.33%   94.33%           
=======================================
  Files        1087     1087           
  Lines       92765    92819   +54     
=======================================
+ Hits        87508    87563   +55     
+ Misses       5257     5256    -1     
Flag Coverage Δ
servertests 29.47% <33.15%> (+0.01%) :arrow_up:
unittests 94.30% <98.36%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 20 '24 19:05 codecov[bot]

This is now part of moto >= 5.0.8.dev14

github-actions[bot] avatar May 21 '24 15:05 github-actions[bot]