Swift on AWS with the Serverless Application Model (SAM)

The AWS Serverless Application Model, known as SAM, is a command line utility that creates serverless applications on AWS. These applications primarily focus on AWS Lambda functions, Amazon API Gateway, and Amazon DynamoDB. Your applications, however, can include any AWS services, such as S3 buckets, SQS queues, SNS topics, IoT, or Amazon AI services.

Using the SAM CLI you can:

  • initialize a serverless application from a predefined template or create one from scratch
  • build the application (for Swift this means compiling your Swift code for distribution as a Lambda function)
  • deploy the application to AWS using Infrastructure as Code via CloudFormation. This creates all the resources used in your application (Lambda functions, API Gateway, Databases, S3 Buckets, etc...) in your AWS account

To get started, follow the instructions on this guide. We have seeded the library with 2 sample application templates, and intend to add more.