[Video] Deploying an Email System with SwiftCloud

Published: December 11, 2024
Written by:
Natan Rolnik
Natan Rolnik

In one of our earlier articles, we made an introduction to SwiftCloud, a package that lets you define your cloud infrastructure using Swift code. You declare which components you want - serverless functions, databases, servers, CDNs, buckets… - and it takes care of building the targets, creating the resources in the cloud provider, and setting them up with the correct permissions. In that post, we showed how to deploy two functions to AWS Lambda.

Since then, we added here to this website a way for readers to subscribe to email updates (check the email button in the header) when new posts are published. We built this system, you guessed it right, in Swift. To show how to deploy it with SwiftCloud, we invited once again Andrew Barba, its creator.

In the video below we do a quick recap of what is SwiftCloud, and give an overview of the mailing system and its components. We move on to cover how to add a new target as the cloud infra into an existing project, and configure an AWSProject on it. First we deploy one function to AWS Lambda: an HTTP interface to the mailing system, followed by configuring and linking to it both SQS (Simple Queue Service) and DynamoDB. Then we setup another function that will be triggered by SQS, process these jobs by using SES (Simple Email Service) to actually send the emails. Finally, we cover environment variables and wrap up with some notes about SwiftCloud.

Chapters:

  • 00:00 Intro
  • 00:45 An Overview of the Project
  • 02:40 What’s SwiftCloud?
  • 04:50 Adding SwiftCloud to the Project
  • 14:56 Deploying and Testing the 1st Lambda
  • 17:25 Adding DynamoDB, SQS and SES
  • 28:45 Using Resources in Lambda
  • 31:56 Deploying Again
  • 35:06 Environment Variables
  • 42:46 Wrapping Up
Swift, Xcode, the Swift Package Manager, iOS, macOS, watchOS and Mac are trademarks of Apple Inc., registered in the U.S. and other countries.

© Swift Toolkit, 2024-2025