Skip to content

Instantly share code, notes, and snippets.

@pascalwhoop
Created April 26, 2020 20:46
Show Gist options
  • Save pascalwhoop/ad20756c88d0d8757791f0d78e871a57 to your computer and use it in GitHub Desktop.
Save pascalwhoop/ad20756c88d0d8757791f0d78e871a57 to your computer and use it in GitHub Desktop.
gcloud rsync -r gs://our-bucket /tmp/bucket
cd 0-bootstrap && vim backend.tf #comment out backend
terraform init #approve copying state to local
gcloud rm -r gs://our-bucket #delete all data
terraform apply #force recreates bucket in different region
gcloud rsync -r /tmp/bucket gs://our-bucket #bring state files back
gcloud rm -r gs://our-bucket/terraform/state/bootstrap #clean old state
vim backend.tf #uncomment the backend again
terraform init #copy state back to bucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment