Pulling data from S3 using an address and access key from Python
I've been given a path to an S3 bucket and a key to access it, how can I access the bucket? and how can I do it from Python?
The name looks like this solutions/accounts/services
and the key is some string.
I tried doing this:
import boto3
response = client.get_object(
Bucket='solutions',
Key='accounts/services'
)
print(response)
This yields:
botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the GetObject operation: Access Denied
I was provided a key to this S3 bucket in the form of : OKIA4RBSCI236N869IJG
Where does this key need to be inserted?
The Key should include all the folders. Example: accounts/services/file.txt
.
The Bucket name should only be the bucket name. Example: solutions
.
This will get you s3://solutions/accounts/services/file.txt
.