Getting started»
Spacelift provides an AWS CloudFormation example repository you can fork and use to set up your own CloudFormation stacks.
Looking at the code, you'll find that it creates two simple Lambda Functions in nested Stacks and a common API Gateway REST API, which provides access to both of them.
Creating the stack»
- On the Ship Infra > Stacks page, click Create new stack, then Create manually.
- Name, describe, and label the stack, and select which space to create it in.
- Connect to source code and select your CloudFormation repository and branch.

- On the Choose vendor page, select CloudFormation and fill in details:
- Region: Enter the AWS region you want to create your CloudFormation Stack in (e.g. eu-west-1 or us-east-1).
- Stack name: Enter a CloudFormation stack name unique to your AWS account.
- Entry template file: Enter the path to the template file that describes your root CloudFormation stack. For our example repository, this is
main.yaml. - Template bucket: Create and name (without using any periods
.) an Amazon S3 bucket for template storage, then enter its name in the field. Spacelift will not automatically create this bucket.
- Alter the behavior, roles, and stack hooks settings if needed.
- On the Attach cloud page, select the AWS integration configured to give Spacelift access to your AWS account.
- On the Summary page, click Confirm to create the stack.

Deploying the stack»
Click Trigger to create a new Spacelift Run. When it reaches the unconfirmed state, you will see detailed information about each resource that is supposed to be created. To apply the planned changes, click Confirm.
Spacelift will display a feed of the creation and update events as they happen in the root stack (and all nested stacks).
If you are using the example repository, switch to the Outputs tab and locate the URLBase output. You can curl that URL with a hello1 or hello2 suffix to get responses from the Lambda functions.

Configuring capabilities»
If you are using the provided CloudFormation example repository, the run will fail because we have not configured the relevant stack capability, CAPABILITY_IAM\. To add it:
- Navigate to the Environment tab.
- In the Environment variables section, click Add variable.
- Fill in variable details:
- Name: Enter the variable name. For our example, use
CF_CAPABILITY_IAM. - Value: Enter the variable's value. For our example, use
1. - Mark as secret: We recommend enabling this option to only provide variable values to runs and tasks. They will not be visible in the Spacelift UI or via the API.
- Description (optional): If desired, enter a description for the environment variable.
- Name: Enter the variable name. For our example, use
There are many optional settings for CloudFormation stacks you can configure in this way.
Conclusion»
You can find more details about the available configuration settings in the reference, or see how to use AWS Serverless Application Model (SAM) or the Serverless Framework to generate your CloudFormation templates.