I am not able to see the downloaded file from s3 bucket in /tmp/ folder of lambda.I have provided full access over S3 and Lambda in IAM policy. When I'm testing this code, my tmp folder is always empty(refer screenshot).
Can some-one help me out??
My code :
import csv
import boto3
s3_client = boto3.client('s3')
s3_resource = boto3.resource('s3')
def lambda_handler(event, context):
bucket = 'test-bucket'
key = 'data/original_file1.csv'
try:
temp_path= '/tmp/test_file.csv'
s3_resource.Bucket(bucket).download_file(key,temp_path)
response = s3_client.get_object(Bucket=bucket, Key=key)
return response['ContentType']
except Exception as e:
print(e)