Skip to content

Commit c596f30

Browse files
michal.krupamichal.krupa
authored andcommitted
Updated message when the S3 bucket is not found.
1 parent 82596f3 commit c596f30

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AWSscripts/SQS3script.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ def get_args():
287287
def get_bucket(session, bucket_name):
288288
bucket = session.resource('s3').Bucket(bucket_name)
289289
if bucket.creation_date is None:
290-
print('S3 bucket {} does not exist, please create it and run the script again'.format(bucket_name))
290+
region = boto3.session.Session().region_name
291+
print('\033[91m', 'S3 bucket {} does not exist, please create it and run the script again. Also, make sure the S3 bucket and the SQS queue are in the same region. Current session region: {}'.format(bucket_name, region))
291292
sys.exit(1)
292293
return bucket
293294

0 commit comments

Comments
 (0)