AWS Serverless Application Repository
Think of it as "GitHub for AWS Serverless architectures." It is a library where you can find, deploy, and publish pre-built serverless applications.
- 1. The Core Exam Concept: "Don't Reinvent the Wheel"
The primary exam scenario for SAR is reducing duplicated effort.
- Scenario: Your company has 50 different teams. Every team needs a specific Lambda function that rotates API keys or resizes images.
- Bad Solution: Every team writes their own Lambda code (wasted time, inconsistent quality).
- Exam Answer (SAR): One team writes the "Gold Standard" function, publishes it to the Serverless Application Repository (Private), and all 50 teams just "pull and deploy" it into their accounts.
- 2. Key Technical Features (Exam Cheat Sheet)
- A. How it works (The Stack)
- Underlying Tech: It runs on AWS SAM (Serverless Application Model).
- Deployment: When you "deploy" an app from the Repository, it actually creates a CloudFormation Stack in your account.
- Nested Applications: You can include a SAR application inside your own serverless application. It becomes a "Nested Stack."
- Exam Tip: If a question asks how to include a reusable auth module in your SAM template without copying the code, look for "Nested Application" or "AWS::Serverless::Application".
- B. Sharing Models (Public vs. Private)
The exam often tests who can see your application.
- Public: Shared with the world (anyone with an AWS account).
- Private: Only visible to the account that created it.
- Privately Shared (Critical): Shared with specific AWS Account IDs or an entire AWS Organization.
- Keyword: "Resource-based Policy." You control access by attaching a policy to the application, just like an S3 Bucket Policy.
- C. Cost
- The Service: Free. There is no charge to host or browse the repository.
- The Resources: You Pay. If you deploy a Lambda function from the repository, you pay for that Lambda's invocations and duration in your account.
- 3. Serverless Repo vs. AWS Marketplace
This is a common confusion point on the exam.
| Feature | Serverless App Repository | AWS Marketplace |
|---|---|---|
| Primary Use | Internal code sharing / Open Source patterns. | Selling/Buying enterprise software. |
| Cost | Free to use (pay for underlying resources). | Often has licensing fees (SaaS subscriptions). |
| Publisher | Developers, Internal Teams. | Independent Software Vendors (ISVs) like Splunk, Palo Alto. |
| Exam Trigger | "Share reusable code across teams," "Standardize serverless patterns." | "Buy a managed firewall," "Deploy a third-party AMI," "Pay hourly software fees." |
- 4. Example Exam Question Scenario
Question: A company wants to standardize a serverless backend for their mobile apps. Multiple development teams need to use the same backend structure (API Gateway + Lambda + DynamoDB) but strictly within their own AWS accounts. The solution must minimize code duplication and ensure all teams use the approved architecture.
Correct Answer: Use AWS SAM to define the application. Publish it to the AWS Serverless Application Repository with Private Sharing enabled for the company's AWS Organization. Instruct teams to deploy the application from the repository as a nested stack.
Why:
- SAM: Defines the serverless structure.
- Repo: Centralizes the storage.
- Private/Org Sharing: Secures it so only employees can see it.
- Nested Stack: Allows them to integrate it easily.