I have the following script to list trails from CloudTrail:
import boto3
import os
os.environ['AWS_DEFAULT_REGION'] = 'us-east-2'
current_session = boto3.session.Session(profile_name='production')
client = current_session.client('cloudtrail')
response = client.list_trails()
print(response)
This only gives me the list in us-east-1
.
I have tried setting the variable by passing it as an argument to the session and also setting it as env var on command line but it only looks at us-east-1
.
Any suggestions?