I have a lambda function making a s3 HeadObject call. Even though there has been a custom policy made for this lambda function, I keep getting an 403 error whenever this HeadObject call is made. There is specifically;
An error occurred (403) when calling the HeadObject operation: Forbidden
My policy very clearly allows GetObject calls for the bucket in question. Not sure what the problem is. I have triple check that it all lines up. The line in question is:
s3 = boto3.client('s3')
local_file_path = '/tmp/' + key_name.split('/')[-1] + '_REMOTE.json'
response = s3.head_object(Bucket=environ['OUTPUT_BUCKET'], Key=OUTPUT_FILE_NAME)
Let me know if I can provide more info to help