Skip to content

Serverless Application Repository

CloudMock emulates the AWS Serverless Application Repository (SAR), supporting application publishing, versioning, and deployment via CloudFormation change sets.

OperationStatusNotes
CreateApplicationSupportedCreates an application with semantic version (X.Y.Z format required)
GetApplicationSupportedReturns application details
ListApplicationsSupportedLists all applications
UpdateApplicationSupportedUpdates description, author, homepage URL, and labels
DeleteApplicationSupportedDeletes an application and all its versions
CreateApplicationVersionSupportedCreates a new semantic version for an application
ListApplicationVersionsSupportedLists versions sorted by semantic version
CreateCloudFormationChangeSetSupportedCreates a change set for deploying the application
import {
ServerlessApplicationRepositoryClient,
CreateApplicationCommand,
CreateApplicationVersionCommand,
} from '@aws-sdk/client-serverlessapplicationrepository';
const client = new ServerlessApplicationRepositoryClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
// Create an application
const app = await client.send(new CreateApplicationCommand({
Name: 'my-serverless-app',
Author: 'myteam',
Description: 'A sample serverless application',
SemanticVersion: '1.0.0',
SpdxLicenseId: 'MIT',
}));
console.log(app.ApplicationId);
// Create a new version
await client.send(new CreateApplicationVersionCommand({
ApplicationId: app.ApplicationId,
SemanticVersion: '1.1.0',
SourceCodeUrl: 'https://github.com/example/my-app',
}));
import boto3
client = boto3.client('serverlessrepo',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
# Create an application
response = client.create_application(
Name='my-serverless-app',
Author='myteam',
Description='A sample serverless application',
SemanticVersion='1.0.0')
app_id = response['ApplicationId']
# Update the application
client.update_application(
ApplicationId=app_id,
Description='Updated description')
# Deploy via change set
client.create_cloud_formation_change_set(
ApplicationId=app_id,
SemanticVersion='1.0.0',
StackName='my-app-stack')
cloudmock.yml
services:
serverlessrepo:
enabled: true
  • Semantic versions must match the X.Y.Z format (with optional pre-release and build metadata)
  • CloudFormation change sets are created as stubs; no actual CloudFormation deployment occurs
  • Template URLs are synthetic S3 URLs and are not accessible
  • Application sharing and marketplace features are not emulated