Getting Started
18 min
hello and welcome to spacelift! in this guide we will briefly introduce some key concepts that you need to know to work with spacelift these concepts will be followed by getting started md#step by step to help you create and configure your first run with spacelift introduction to main concepts stacks a stack is a central entity in spacelift it connects with your source control repository and manages the state of infrastructure it facilitates integration with cloud providers (aws, azure, google cloud) and other important spacelift components you can learn more about stacks in spacelift concepts/stack/ state management state can be managed by your backend or can be imported into spacelift for terraform projects it is not required to let spacelift manage your infrastructure state worker pools spacelift provides public and private worker pools that execute spacelift workflows public worker pools are managed by spacelift whereas private pools are hosted by you due to security and compliance requirements, several of our customers choose private pools to manage their infrastructure you can learn more about worker pools concepts/worker pools md policies spacelift policies provide a way to express rules as code, rules that manage your infrastructure as code (iac) environment, and help make common decisions such as login, access, and execution policies are based on the https //www openpolicyagent org project and can be defined using its rule language rego you can learn more about policies concepts/policy/ cloud integration spacelift provides native integration with aws, azure and google cloud (gcp) integration with other cloud providers is also possible via programmatic connection with their identity services you can learn more about integrations/cloud providers/ in spacelift detailed documentation change workflow spacelift deeply integrates with your version control system (vcs) pull requests are evaluated by spacelift to provide a preview of the changes being made to infrastructure; these changes are deployed automatically when prs are merged you can learn more about integrations/source control/ here \\ step by step this section provides step by step instructions to help you set up and get the most out of spacelift if you want to learn about core concepts, please have a look at the getting started md#introduction to main concepts section you can get started with either forking our terraform starter repository and testing all spacelift capabilities in under 15 minutes or you can explore spacelift on your own by adding your own repository and going from zero to fully managing your cloud resources https //github com/spacelift io/terraform starter getting started md#first stack run first stack run this tutorial will help you complete your first stack and run it assumes you use your own repository step 1 setup your spacelift account on the spacelift home page, select the "get started" button at the top right corner of the page enter your e mail address and click "sign up" note currently, spacelift accounts are associated with your selected github account or github organization after clicking "sign up", you'll need to select an organization you are a member of, your personal account, or create a new github organization to use with spacelift the github organization/account name selected will be used as your spacelift account name step 2 connect with your vcs https //github com/apps/spacelift io/installations/new if you have not already installed it during the signup process attach any of your terraform repositories that create local resources (we will not not be integrating any of the cloud providers to keep our first run simple) now login to the spacelift console, you are ready to create your first stack! step 3 create your first stack click on the add stack button in the integrate vcs form, choose your vcs provider, select the repository that you gave access to spacelift in the first step and select a branch that you want to be attached with your stack click on continue to configure the backend choose terraform as your backend with a supported version leave the default option to let spacelift manage state for this stack leave the default options checked for define behavior and click continue give a name to your stack and save step 4 trigger your first run saving the stack will lead you to the runs screen click on trigger to kick start a spacelift job that will check out the source code, run terraform commands on it and then present you with an option to apply (confirm) these changes click on confirm and your changes will be applied your output will look different based on your code repository and the resources it creates further reading learn how to integrations/cloud providers/aws md as a cloud provider for your infrastructure try concepts/policy/#creating policies with stacks for common use cases integrations/source control/github md#pull requests concepts/worker pools md using concepts/configuration/environment md#environment variables and concepts/configuration/context md with stacks concepts/stack/stack settings md