In many AWS programs (not don't use S3), I have the following:
session = boto3.Session(profile_name='myname')
awsclient = session.client(service_name='s3', region_name='us-east-2', use_ssl=True)
Most examples of S3 resource look like this:
s3_resource = boto3.resource('s3') # high-level interface
Is there a way I can get the resource from the awsclient variable above, after establishing my profile and region? Or alternatively, how can I specify the profile name on an S3 Resource?
My goal is to have some consistency from one program to the other in how we connect and specify region/credentials.
This partially answers: How to specify credentials when connecting to boto3 S3? but doesn't address how to specify region.