Closed daeho-ro closed 4 months ago
Hi @daeho-ro thanks for reaching out. I tried to reproduce this for buckets in us-east-1
and us-west-2
, but I received BucketRegion
in the response for both. The head_bucket Boto3 command involves a call to the S3 HeadObject API and is returning the response from the API. If you are seeing results that are inconsistent with the documentation, then you may be using an older version of Boto3.
Which version of Boto3 are you using? The latest is 1.34.142, we recommend updating to a recent version if possible. You can find instructions on bundling a recent copy of Boto3 in Lambda here.
If still seeing the issue after updating, please share your debug logs (with sensitive info redacted) by adding boto3.set_stream_logger('')
to your script.
Indeed, the version is key. I have used the docker image public.ecr.aws/lambda/python:3.11.2023.07.13.17-arm64
and as you noticed that the date is not that recent. So I have changed the tag without date 3.11-arm64
and finally got correct answer.
Thanks, @tim-finnigan
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Describe the bug
Hello, I want to know the bucket location and so I used
head_bucket
for s3 client.and I received ResponseMetadata as follows:
You cannot find the BucketRegion key even though the response indicates the status code 200. This is only happen when I run the code on the
us-east-1
region of AWS lambda.Expected Behavior
It should somehow contains the
'BucketRegion': 'us-east-1'
key and value in the response dict.Current Behavior
It does not contain
BucketRegion
key.Reproduction Steps
Simply write the code to call
head_bucket
method and deploy to the regionus-east-1
of AWS Lambda, run the code.Possible Solution
No response
Additional Information/Context
No response
SDK version used
Installed on docker build, maybe latest
Environment details (OS name and version, etc.)
Docker on public.ecr.aws/lambda/python:3.11.2023.07.13.17-arm64