This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_presigned_url(s3, bucketname, key): | |
import boto3 | |
from botocore.client import Config | |
region = 'us-east-2' | |
s3 = boto3.client( | |
's3', | |
endpoint_url=f'https://s3.{region}.amazonaws.com', | |
config=Config(s3={'addressing_style': 'virtual'})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
def lambda_handler(event, context): | |
print('Received event: ' + json.dumps(event, indent=2)) | |
response = { | |
"statusCode":200, | |
"headers": { "Access-Control-Allow-Origin": " *", "Content-Type" : 'application/json' }, | |
"body": json.dumps(event) | |
} |