Serverless Template Formats
You can import existing projects or create new stacks in Stackery based on several types of infrastructure-as-code templates. This means that if you already have a repository with a valid template, you can either import that repository directly, or create a new repository based on it.
A serverless template describes the cloud resources AWS CloudFormation will provision when creating a stack. The template also defines relationships between resources, such as permissions for resources to interact with each other.
Supported Template Formats
Stackery provides two levels of support for serverless IaC templates.
For AWS SAM and many AWS CloudFormation resources, Stackery provides bidirectional editing where template changes are reflected as an interactive architectural diagram and visual design changes auto-generate the appropriate code in your template.
AWS CDK and Serverless Framework templates are also supported, in an experimental fashion. They can be fully leveraged in Stackery's continuous delivery pipeline, complete with environment management, parameter, and secrets support. Bidirectional editing is not supported however post-deployment visualizations are provided.
New stacks are created using the AWS SAM template format by default, though AWS SAM, AWS CloudFormation, AWS CDK, and Serverless Framework formats are supported.
AWS Serverless Application Model (AWS SAM)
AWS SAM is an open-source template specification created by AWS. AWS SAM is supported directly by AWS CloudFormation, which allows the application's template flexibility while maintaining syntax consistency.
An AWS SAM stack is typically defined in a template.yaml
file saved in the root directory of your serverless project. Formatting rules for AWS SAM templates are specified in detail in the README of the AWS SAM repository.
For more information about using AWS SAM templates, see the AWS SAM docs.
Serverless Framework
The Serverless Framework is a tool created by Serverless Inc. that offers a simplified way to getting started with serverless resources, and relies on additional CloudFormation or third-party plug-in usage as the application grows.
The Serverless Framework has developed its own serverless template specification, which is defined in a serverless.yml
file. For more information about using Serverless Framework templates, see the Serverless.yml Reference.
To enable serverless framework support in Stackery, you’ll need to run stackery settings --stack-name <stack name> --key framework --value serverless
using the CLI.
You'll also need to update the path to the template file: stackery settings --stack-name <stack name> --key templatePath --value <path to template>
Lastly, you'll need to add a new deployment spec file in your repo named stackery.deployspec.yaml. Inside, you'll scaffold it with the following text:
stages:
setup:
- stackery deploy-stage setup
build:
- stackery deploy-stage build
addIntegrations:
- stackery deploy-stage add-integrations
- stackery deploy-stage add-environment-context
package:
- stackery deploy-stage package
submitChangeSet:
- stackery deploy-stage submit-change-set
executeChangeSet:
- stackery deploy-stage execute-change-set
Adding Existing Projects
In the Dashboard
To import an existing project into Stackery, navigate to the Stacks page of the Stackery app, and click the Add a Stack dropdown in the upper-right corner to choose With an existing repo.
- Select your Git provider
- Name your stack
- Enter the URL of the repo for Remote URL
- Click Add Stack
In the CLI
Alternatively, you can use the stackery create
CLI command with the flag --use-existing
to import a project using the command line:
stackery create -n my-existing-stack --blueprint-git-url https://github.com/stackery/my-existing-stack --use-existing