Backend State Management
StackGen leverages persisted state data to efficiently track and manage your infrastructure resources. To enable seamless collaboration, you can define a Storage Backend to store state in a remote object storage solution. Thus, ensuring that multiple team members can securely access and modify state data while working on StackGen.
The Storage Backend feature also enables centralised state management for your cloud deployments, ensuring infrastructure consistency across teams.
Configure Storage Backend in StackGen
Follow these steps to configure your storage backend:
Prerequisites
You’ll have to pre-create backend resources in your cloud, as OpenTofu requires backend configuration at the time of initialisation.
Enable Storage Backend
To enable storage backend, follow these steps:
- From the StackGen home page, navigate to appStacks > Backend Configuration.
- Turn the Enable Storage Backend toggle on.
- From the Select the backend type dropdown, choose the storage backend where you want to manage state files for your teams. The State Backend feature provides centralized storage solutions such as:
- AWS S3
- Google Cloud Storage (GCS)
- Azure Storage
- PostgreSQL
- Local storage (not recommended for teams) You can override backend configurations per the environment. For example, you can use S3 for Prod and PostgreSQL for Dev.
- Enter the parameters under the Configure Storage Backend Parameters field to set up your storage backend.
StackGen considers the local backend as the default storage backend unless specified.
- Once done, click Save.
Configure Storage Backend for Environment Profiles
StackGen allows overriding storage backend configurations based on the environment. For example, you can configure S3 as the storage backend for your Production and PostgreSQL for your Development environments.
Additionally, you can modify backend configurations per profile by setting environment-specific values while maintaining a base configuration. To do so, fill out the environment-specific parameters for the backend while creating your Environment Profile. To learn more, refer to the Environment Profile Management for Applications documentation.