After a brief preview period since re:Invent 2017, Amazon Web Services (AWS) recently made its new Serverless Application Repository generally available. Users can now discover, configure, and deploy serverless applications and components via the AWS Lambda console, which AWS considers an "ideal venue for AWS partners, enterprise customers, and independent developers to share their serverless creations".
AWS introduced the Serverless Application Model (SAM) at re:Invent 2016 with the goal to make it easier to "manage and deploy serverless applications on AWS". SAM is an open source specification that extends AWS's infrastructure as code service CloudFormation with specialized resources types and tailored packaging and deployment commands. AWS then followed up with the Docker-based SAM Local so that developers can also "test functions locally, start a local API Gateway from a SAM template, validate a SAM template, and generate sample payloads for various event sources" (previous coverage).
AWS has now added the Serverless Application Repository as a dedicated packaging, discovery and provisioning service for SAM applications. Similar to the still available blueprints feature, it integrates with the AWS Lambda console's create function wizard to guide users through the discovery and deployment steps.
Image: AWS Serverless Application Repository in the Lambda console's create function dialog.
The similarities end there though. While a blueprint only deploys a single function "as a starting point", a SAM application formalizes transparency regarding a solution's required IAM policies and permissions, the to be provisioned AWS resources as declared in the underlying CloudFormation template, and of course its license. Application consumers can then specify required and optional parameters and deploy the solution as a CloudFormation stack. All stack resources are tagged with the application's Amazon Resource Name (ARN) so that they can be identified and monitored in the AWS Management Console.
In turn, this approach comprises a new distribution model for application publishers, who can now also offer their serverless solutions for deployment in a customer's own AWS account. Access to applications is controlled via resource-based IAM policies so that they can be limited to specific teams in the publisher's AWS organization (previous coverage), selectively shared with third-party accounts, or simply made publicly available to any AWS user.
Publicly shared applications also require a link to the application's source code. Many of the existing blueprints have been converted to serverless applications and their source code is available in the examples/apps folder of the SAM GitHub repository accordingly. Jeff Barr (Chief Evangelist AWS) emphasizes the implied freedom for consumers of this new distribution model:
You will be able to tap in to a thriving ecosystem of serverless applications and components [...]. You can configure and consume them as-is, or you can take them apart, add features, and submit pull requests to the author.
To create an application, a publisher needs to define a few common parameters like the application name, author, a description, a readme, and labels, and select an "open-source friendly Software Package Data Exchange (SPDX) license". Application versions can be submitted later and require a semantic version, and of course the SAM template. Two additional constraints are noteworthy:
- Only applications published in either
us-east-1
orus-east-2
are globally available, publishing to other regions restricts the application's availability to that AWS region. - Besides the specialized SAM resource types, the Serverless Application Repository supports several related serverless resource types from all AWS resource types offered by CloudFormation itself. Users are encouraged to contact AWS Support if they would like to request additional ones to be added.
The Serverless Application Repository complements the more comprehensive IT service discovery and governance solution AWS Service Catalog, which is likewise built atop AWS CloudFormation, but focuses on centrally managed IT service portfolios and lifecycles for a much broader type of applications. It can also integrate third-party offerings from ISVs and consulting partners on the AWS Marketplace.
The Serverless Application Repository developer guide features sections on consuming and publishing applications, and its REST API resources reference. The AWS CLI reference and a dedicated FAQ are also available. Support has so far been provided via the AWS Lambda forum and will shift to the new AWS Serverless Application Repository forum going forward. Using the Serverless Application Repository itself is free, provisioned AWS resources like API Gateways, Lambda functions, and DynamoDB tables are subject to their regular usage-based pricing.