Send email with pre-signed URL on file upload into Amazon S3 bucket

Amazon S3 → AWS Lambda → Amazon SES

This sample project shows how to send an email with pre-signed Amazon S3 bucket URL whenever a file is uploaded into the bucket.

User uploads a file into the Amazon S3 bucket.
Amazon S3 triggers the AWS Lambda function.
The AWS Lambda function creates a pre-signed URL with validity of one hour for the uploaded file and calls Amazon SES API.
The Amazon SES sends the notification email.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/s3-lambda-ses-sam

Deploy

See the GitHub repo for detailed deployment instructions.sam deploy -g


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the Amazon S3 email bucket content: aws s3 rm s3://{MyBucketName} --recursive --region {my-region}
Delete the resources deployed to your AWS account via AWS SAM: sam delete

Created by:

Biswanath Mukherjee

Biswanath Mukherjee

Sr. Solutions Architect working at AWS India.

Follow on LinkedIn