From ca5847142c123c42d18f8f0ad1cf7d53fab93cd0 Mon Sep 17 00:00:00 2001 From: igooch Date: Thu, 16 May 2024 13:30:25 -0700 Subject: [PATCH] Adds comment for help troubleshooting issues with terraform tfstate (#3822) * Adds comment to assist with troubleshooting issues with terraform tfstate --- build/terraform/e2e/state-bucket/main.tf | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build/terraform/e2e/state-bucket/main.tf b/build/terraform/e2e/state-bucket/main.tf index e56eb6033c..74d4171321 100644 --- a/build/terraform/e2e/state-bucket/main.tf +++ b/build/terraform/e2e/state-bucket/main.tf @@ -16,6 +16,14 @@ // Run: // terraform apply -var project="" +// If you are getting `Error: googleapi: Error 409: Your previous request to create the named bucket +// succeeded and you already own it., conflict` this means that your local tfstate file has +// divereged from the tfstate file in Google Cloud Storage (GCS). To use the GCS version of the +// tfstate, delete your local .terraform and .tfstate files. You may need to run +// `sudo chown -R yourusername .` to be able to delete them. Then navigate to this directory and run +// `terraform init`. Pull in the tfstate file from gcloud with +// `terraform import google_storage_bucket.default agones-images-e2e-infra-bucket-tfstate`. + // # GCS bucket for holding the Terraform state of the e2e Terraform config. terraform { @@ -40,4 +48,4 @@ resource "google_storage_bucket" "default" { versioning { enabled = true } -} \ No newline at end of file +}