Skip to content

Create Geo replication events for Terraform state deletions

What does this MR do and why?

Replicates Terraform state deletions to Geo secondaries, so that files aren't left orphaned in object storage.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

  1. Enable object storage

  2. Configure a Geo secondary (also with object storage enabled)

  3. Create a basic Terraform project that uses GitLab managed state, for example with the following main.tf:

    terraform {
      backend "http" {
      }
    }
    
    resource "local_file" "test" {
        content  = "test"
        filename = "${path.module}/test.txt"
    }
  4. Modify the content value and run terraform apply a few times, to generate a version history

  5. Verify files are replicated to the secondary's object storage

  6. Visit http://path/to/your/project/-/terraform and select "Remove state and versions"

  7. Verify files are removed from both primary and secondary object storage

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #349011 (closed)

Edited by Tiger Watson

Merge request reports