Very annoying permissions issue here:
- I've been granted access to specific subfolders of an S3 bucket.
- I don't appear to have permissions to the bucket in general.
- I am able to navigate via AWS GUI web interface and upload/download/rename files as I wish.
- I cannot appear to get anything done via boto3 without running into permissions issues.
Anybody know a workaround for this? If possible I'd like to be able to proceed without waiting on permissions to be granted.
Python Code:
import boto3
client = boto3.client(
's3',
aws_access_key_id = 'ACCESSKEY',
aws_secret_access_key = 'SECRET',
region_name = 'us-east-1'
)
resource = boto3.resource(
's3',
aws_access_key_id = 'ACCESSKEY',
aws_secret_access_key = 'SECRET',
region_name = 'us-east-1'
)
client.download_file("BUCKETNAME", "/FOLDER/PATH/FILENAME.json", "LOCALFILENAME")
Response:
ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden
Note: A similar problem occurred in this post: Python boto, list contents of specific dir in bucket. A solution from boto 2.x was to disable the check for permissions of the bucket via "validate = False", but that is obsolete now in boto3. Looking for a similar type solution, I suppose.