AWS Lambda is a serverless, event-driven compute service that lets you run code for virtually any type of application or backend service without provisioning or managing servers. You can trigger Lambda from over 200 AWS services and software as a service (SaaS) applications, and only pay for what you use.
A simple flow might be like the one below:
In our activity, we will be creating a Lambda function that will send an email to its subscribers.
Amazon Simple Notification Service (Amazon SNS) is a fully managed pub/sub messaging service provided by Amazon Web Services (AWS). It enables you to build distributed applications and microservices by allowing them to communicate with each other.
You can even use SNS to produce emails/ SMS texts to your intended recipients.
To get started, we will need to create a few resources below:
IAM roles for AWS Lambda to be able to create AWS Cloudwatch log groups and publish logs to Cloudwatch, as well as to publish messages via SNS.
We will use a simple python code (under lambda_function.py) that will utilize boto3 client to connect and send messages to SNS. This code will take in 3 parameters: name, time and weather.
We will then create the AWS lambda resource with the above python code.
We will also create an SNS topic and create a subscription for an intended email to receive messages.

Should everything be set up successfully, we will be able to receive an email notification with the parameters we have specified, for example:

Once done, remove all the resources that have been created:
- SNS Topic
- Lambda Function
- IAM roles