Trigger Lambda on S3 Upload & Send Email via SNS – Step-by-Step AWS Tutorial

Опубликовано: 21 Март 2026
на канале: Felex Kuria
113
2

Support the stream: https://streamlabs.com/multi-touchcampus
In this video, I’ll show you how to set up AWS S3 event notifications to trigger a Lambda function that sends an email via SNS.
What You’ll Learn:
How to configure your S3 bucket to trigger a Lambda function on object creation events.
How to write a Lambda function (using Python) that extracts the uploaded file details and publishes a message to an SNS topic.
How to create an SNS topic, subscribe your email, and confirm the subscription to receive notifications.
Lambda Code Example:
import json, boto3, urllib.parse
sns = boto3.client('sns')

def lambda_handler(event, context):
record = event['Records'][0]
bucket = record['s3']['bucket']['name']
key = urllib.parse.unquote_plus(record['s3']['object']['key'])
message = f"New file uploaded: s3://{bucket}/{key}"

sns.publish(
TopicArn='arn:aws:sns:us-east-1:123456789012:YourSNSTopic',
Message=message,
Subject="S3 Upload Notification"
)

return { 'statusCode': 200, 'body': json.dumps('Email notification sent!') }
Replace the SNS Topic ARN with your own.
If you’re new to these concepts, check out my previous videos on creating S3 buckets and setting up Lambda functions.
Have questions? Drop a comment below. Please like, subscribe, and share this video with your tech friends!
[VIDEO LINK]
#AWS #Lambda #SNS #S3 #CloudComputing #TechTutorial"