The best way to learn AWS is to actually BUILD something with it! Build something that uses several AWS services, and get all the pieces to work together. In this hands-on tutorial, I’ll walk you through how to design and build a simple serverless email marketing application from scratch. When we’re done, our system will send emails on a schedule, grabbing HTML email templates and a list of contacts from an S3 bucket.
We’ll be working with five different services: Simple Email Service (SES), EventBridge, S3, Lambda, and Identity & Access Management (IAM). As we go, we’ll talk about high-level requirements for each, and then walk through how to set them up.
?***What you need to follow along***?
• Email addresses (to send to) that you can validate (can be personal email addresses)
• An email address (to send from) that you can validate (needs to be from your own domain)
• Basic knowledge of AWS
• A text editor/somewhere to write HTML code (or use mine)
?***CODE referenced in the video***?
• email_template.html: https://drive.google.com/file/d/1XOF6QnrNWNwPz5LUP6jbs_xSi02EU0Zu/view?usp=sharing
• contacts.csv: https://drive.google.com/file/d/1w9MBVaUAmgxnX8uCt8a5fUPnf3MLPw1I/view?usp=sharing
• Lambda Python code, test code, policy for execution role: https://docs.google.com/document/d/13KOINP7wBMHKBwxhyWTV8SFbN6wnC3K1cmxv701pnP0/edit?usp=sharing
? For diagramming and checklists in this video, I used Eraser.io. Check them out! https://www.eraser.io
? For another fun project that uses DynamoDB, API Gateway and Lambda, check out this other video: https://youtu.be/7m_q1ldzw0U
?***MY AWS COURSES***?
If you’re interested in getting AWS certifications, check out these full courses. They include lots of hands-on demos, quizzes and full practice exams. Use FRIENDS10 for a 10% discount!
• AWS Certified Cloud Practitioner: https://academy.zerotomastery.io/a/aff_n20ghyn4/external?affcode=441520_lm7gzk-d
• AWS Certified Solutions Architect Associate: https://academy.zerotomastery.io/a/aff_464yrtnn/external?affcode=441520_lm7gzk-d
?***TIMESTAMPS***?
00:00 – Introducing the AWS project: an email marketing campaign system
00:33 – Services we’ll use: SES, Lambda, S3, EventBridge, IAM
01:05 – How much will this cost?
01:43 – Using Eraser.io to create checklists
03:15 – High-level requirements for the application
04:20 – Creating an S3 bucket to store email templates and contacts
05:10 – The HTML email template we’ll be using to send
05:57 – The CSV file with contact information to email to
06:34 – Uploading the email template and contact list to the S3 bucket
07:22 – Diagramming as code with Eraser.io
07:59 – Setting up Amazon Simple Email Service (SES) with an email address and domain
09:34 – The SES sandbox, limitations, and how to move it to production
10:32 – Sending a test email using Amazon SES
11:17 – Validating email addresses to send to (a requirement for the sandbox)
12:57 – Using Lambda to create and send personalized emails to SES
13:35 – Adding connections between nodes in Eraser.io
14:32 – Creating a new Python Lambda function for email logic
17:54 – Configuring and running a test event for the Lambda function
19:10 – GetObject operation: Access Denied error when trying to retrieve from the S3 bucket from Lambda
19:49 – Updating the Lambda execution role with appropriate permissions
20:35 – Creating a new policy with permissions for S3 and SES
22:08 – Attaching the policy to the Lambda execution role
23:28 – Testing the Lambda function again with updated permissions
24:10 – How to trigger the Lambda function to send emails on a schedule
25:15 – Creating a new schedule using EventBridge
27:29 – Testing the EventBridge schedule for sending emails
29:46 – CHALLENGE: Ideas to enhance the application!
30:40 – IMPORTANT! Deleting your resources