How to access keys from buckets with periods (.) in their names using boto3?

前端 未结 2 1001
忘了有多久
忘了有多久 2021-01-18 21:35

Context

I am trying to get an encryption status for all of my buckets for a security report. However, since encryption is on a key level basis, I want to iterate t

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-18 22:31

    There are a couple of github issues on this. It's related to the region of the bucket. Make sure that your S3 resource is in the same region as the bucket you've created.

    FWIW you can determine the region programmatically like this:

    s3.meta.client.get_bucket_location(Bucket='boto3.region')
    

提交回复
热议问题