Skip to content

This Serverless App automatically deploys new versions of an serverless app in AWS Serverless Application repository

License

Notifications You must be signed in to change notification settings

honglu/aws-serverlessrepo-auto-deploy

Repository files navigation

aws-serverlessrepo-auto-deploy Build Status

This serverless application automatically deploys new versions of an serverless app in AWS Serverless Application repository into your account.

App Architecture

App Architecture

  1. The app creates a CloudWatch Rule that will invoke a Lambda function on a schedule.
  2. When the Lambda function is invoked, it gets the application id and semantic version from the given CloudFormation stack.
  3. 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.
  4. The Lambda function then deploys the latest semantic version of the application to CloudFormation.

Installation Instructions

  1. Create an AWS account if you do not already have one and login
  2. Go to the app's page on the Serverless Application Repository and click "Deploy"
  3. Click "Copy as SAM Resource"
  4. Create your own SAM template by pasting the application resource into your SAM template and fill in the parameters (see parameter details below)
  5. 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
  6. Deploy your SAM template: sam deploy --template-file <path-to-your-sam-template> --stack-name <your-stack-name> --capabilities CAPABILITY_AUTO_EXPAND

App Parameters

  1. LogLevel (optional) - Log level for Lambda function logging, e.g., ERROR, INFO, DEBUG, etc. Default: INFO
  2. ApplicationId (required) - The application id of the application in AWS Serverless Application Repository.
  3. 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 without serverlessrepo- prefix.
  4. Schedule (optional) - CloudWatch event schedule to invoke the Lambda function. Default is rate(1 day) or once per day.
  5. ParameterOverrides (optional) - A JSON string representation of the parameter overrides for the application. Default is an empty list.
  6. Capabilities (optional) - A JSON string representation of the capabilities for the application. Default is an empty list.

App Outputs

  1. ApplicationAutoDeployerFunctionName - Application Auto Deployer Lambda function name.
  2. ApplicationAutoDeployerFunctionArn - Application Auto Deployer Lambda function ARN.
  3. ApplicationAutoDeployerRoleName - Application Auto Deployer Lambda function role name.
  4. ApplicationAutoDeployerRoleArn - Application Auto Deployer Lambda function role ARN.

License Summary

This code is made available under the MIT license. See the LICENSE file.

About

This Serverless App automatically deploys new versions of an serverless app in AWS Serverless Application repository

Resources

License

Stars

Watchers

Forks

Packages

No packages published