How do I use an existing S3-managed Terraform state with Spacelift?

Last updated: September 15, 2025

Context

When setting up a new stack in Spacelift, you may want to use an existing Terraform state that is already managed in your own S3 bucket, rather than having Spacelift manage the state. This requires specific configuration during stack creation and a follow-up action to ensure Spacelift can read your existing state.

Answer

To use your existing S3-managed Terraform state with Spacelift:

  1. When creating a new stack, set the "Manage state" option to false in the vendor configuration section.

  2. Keep your existing backend configuration in your Terraform code that points to your S3 bucket.

  3. After creating the stack, trigger a dry run or apply to allow Spacelift to read the existing state from your S3 bucket.

Important notes:

  • The state management option can only be configured during initial stack creation and cannot be changed afterward.

  • Initially, the stack may show state as "none" until you perform the first run.

Sources: