From ddb05fe12eb3cd25e8cc6c84014b8e6f5791ad29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Pedroche?= <129501338+raulpedroche@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:10:07 +0200 Subject: [PATCH] Use HeadBucket instead of GetBucketLocation (#1979) --- plugins/connection/aws_ssm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/connection/aws_ssm.py b/plugins/connection/aws_ssm.py index 173dd6a084c..a53b3945f98 100644 --- a/plugins/connection/aws_ssm.py +++ b/plugins/connection/aws_ssm.py @@ -404,10 +404,10 @@ def _get_bucket_endpoint(self): ) # Fetch the location of the bucket so we can open a client against the 'right' endpoint # This /should/ always work - bucket_location = tmp_s3_client.get_bucket_location( + head_bucket = tmp_s3_client.head_bucket( Bucket=(self.get_option("bucket_name")), ) - bucket_region = bucket_location["LocationConstraint"] + bucket_region = head_bucket["ResponseMetadata"]["HTTPHeaders"]["x-amz-bucket-region"] if self.get_option("bucket_endpoint_url"): return self.get_option("bucket_endpoint_url"), bucket_region