Boto3: Unable to access S3 object with a name not conforming the regex

Created on 3 Aug 2016  路  1Comment  路  Source: boto/boto3

I am trying to access S3 object which address is like this
"bucket-name/data/organization_id=111111/".

In any way I tried to reach it with boto3 I got

Invalid bucket name "bucket-name/data/organization_id=111111/": Bucket name must match the regex "^[a-zA-Z0-9.\-_]{1,255}$"

The real problem lies in the fact that I do not have read rights to either "bucket-name" or "bucket-name/data". I can access only the full path.

botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied

Is there any way to this at all with boto3?
If not at the moment, it would be an awesome thing to have.

Most helpful comment

I found a way to do it and will drop a code snippet here, in case anybody needs it (although I am aware that github issues are not stack-overflow).

s3_client = session.client('s3')
objects = s3_client.list_objects(Bucket='bucket-name', Prefix='data/organization_id=111111/')

>All comments

I found a way to do it and will drop a code snippet here, in case anybody needs it (although I am aware that github issues are not stack-overflow).

s3_client = session.client('s3')
objects = s3_client.list_objects(Bucket='bucket-name', Prefix='data/organization_id=111111/')
Was this page helpful?
0 / 5 - 0 ratings