Support versioning for Terraform state backend
Release notes
Having access to previous versions of a Terraform state is a necessity both for compliance and occasional debugging needs. Support for versioning of GitLab Managed Terraform states is provided from GitLab 13.4. Versioning is turned on automatically for new Terraform state files. Existing GitLab Managed Terraform state files will be migrated automatically to versioned storage in a later release.
https://docs.gitlab.com/ee/user/infrastructure/#gitlab-managed-terraform-state
Problem to solve
As a Software Developer, I need a way to see previous versions of Terraform state files, in order to debug and fix infrastructure changes.
As a Compliance Manager, I need a way to see previous versions of Terraform state files, in order to have evidence about the state of infrastructure in retrospect.
The Terraform backend state can support versioning for rollback or auditing purposes.
Intended users
Definition of done
-
API-only access to Terraform versions as part of GitLab Core - ~~[ ] UI based access to Terraform state versions as part of GitLab Premium~~ Moved to #254640 (closed)
-
[ ] Ability to rollback to previous version of State(Why this is not part of DoD?)
Proposal
- provide a GUI to show a list of state file versions, linked to
git commit
- provide a GUI to show a JSON output of the state file
- the list and single state file views can be accessed by project maintainers rights