I have a Python app that uses boto3 to list & read objects from AWS S3 buckets:
session = boto3.session.Session(aws_access_key_id=XYZ, aws_secret_access_key=ABC)
client = session.resource('s3').meta.client
listing = client.list_objects(…)
The app works great except for buckets in the China region, where it blows up with The AWS Access Key Id you provided does not exist in our records
(the access key & secret are correct).
I googled up something about providing special ARNs / URLs for AWS in China, here and here. But what do I do in practice, concretely?
If the bucket is in China, how do I initialize the boto3 client so that the rest of my code works as normal?