This serverless application automatically deploys new versions of an serverless app in AWS Serverless Application repository into your account.
- The app creates a CloudWatch Rule that will invoke a Lambda function on a schedule.
- When the Lambda function is invoked, it gets the application id and semantic version from the given CloudFormation stack.
- If the stack already exists, it checks whether the current latest semantic version is newer than the deployed semantic version. If no, the Lambda will exit.
- The Lambda function then deploys the latest semantic version of the application to CloudFormation.
- Create an AWS account if you do not already have one and login
- Go to the app's page on the Serverless Application Repository and click "Deploy"
- Click "Copy as SAM Resource"
- Create your own SAM template by pasting the application resource into your SAM template and fill in the parameters (see parameter details below)
- Add any permissions that are required to deploy the application you would like to setup the auto deploy as
AWS::IAM::Policy
resource in your SAM template. See Example - Deploy your SAM template:
sam deploy --template-file <path-to-your-sam-template> --stack-name <your-stack-name> --capabilities CAPABILITY_AUTO_EXPAND
LogLevel
(optional) - Log level for Lambda function logging, e.g., ERROR, INFO, DEBUG, etc. Default: INFOApplicationId
(required) - The application id of the application in AWS Serverless Application Repository.StackName
(required) - The stack name for the application. If you already have a stack that is created by AWS Serverless Application Repository, please provide the stack name you used when you created the stack via AWS Serverless Application Repository. For example, the stack name withoutserverlessrepo-
prefix.Schedule
(optional) - CloudWatch event schedule to invoke the Lambda function. Default israte(1 day)
or once per day.ParameterOverrides
(optional) - A JSON string representation of the parameter overrides for the application. Default is an empty list.Capabilities
(optional) - A JSON string representation of the capabilities for the application. Default is an empty list.
ApplicationAutoDeployerFunctionName
- Application Auto Deployer Lambda function name.ApplicationAutoDeployerFunctionArn
- Application Auto Deployer Lambda function ARN.ApplicationAutoDeployerRoleName
- Application Auto Deployer Lambda function role name.ApplicationAutoDeployerRoleArn
- Application Auto Deployer Lambda function role ARN.
This code is made available under the MIT license. See the LICENSE file.