How to access S3 bucket from url using boto3?

Viewed 6532

I have been given access to an S3 bucket:

S3 base path : s3://folder1/folder2/*

with an IAM user account:

arn:aws:iam::< Account >:user/< username >

I've tried the following but no luck.

import boto3
client = boto3.client(
    's3',
    aws_access_key_id='****',
    aws_secret_access_key='****'
)
obj1 = client.get_object("folder1/folder2/*") #TypeError
obj2 = boto3.resource("folder1/folder2/*") # DataNotFoundError

Any help regarding this would be appreciated. Thanks!

1 Answers
Related