Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GCS as a history storage #103

Merged
merged 5 commits into from
Aug 25, 2022

Conversation

KengoTODA
Copy link
Contributor

Just like #23, this PR adds a support for GCS history backend.
But it provides less configurations than #23, refer to minamijoyo/tfmigrate-storage#3 for detail.

@minamijoyo
Copy link
Owner

Hi @KengoTODA, Thank you for working on this!

I tried to test this branch with docker-compose, but failed to initialize the test fixture for storage_gcs.

$ docker-compose build
$ docker-compose run --rm tfmigrate /bin/bash

bash-5.1# mkdir -p tmp/dir1 && cd tmp/dir1
bash-5.1# terraform init -from-module=../../test-fixtures/storage_gcs
Copying configuration from "../../test-fixtures/storage_gcs"...


Initializing the backend...
╷
│ Error: Failed to get existing workspaces: querying Cloud Storage failed: googleapi: Error 401: Anonymous caller does not have storage.objects.list access to the Google Cloud Storage bucket., required
│
│
╵

bash-5.1# terraform -v
Terraform v1.2.8
on linux_amd64
bash-5.1# echo $STORAGE_EMULATOR_HOST
http://fake-gcs-server:4443

I guess the error looks related to an issue mentioned in #23 (comment) by @w1mvy 🤔

@KengoTODA Was it successful on this branch in your environment?

@KengoTODA
Copy link
Contributor Author

Thanks for your review!
It's my mistake, I've added necessary code to run the terraform and tfmigrate in the container.
Sorry for making you got confused!

@KengoTODA KengoTODA requested a review from minamijoyo August 25, 2022 06:21
@minamijoyo
Copy link
Owner

It works now. It's a bit tricky but acceptable to use s3 backend as Terraform state backend for testing gcs storage as tfmigrate history 👍

Signed-off-by: Kengo TODA <skypencil+github@gmail.com>
Copy link
Owner

@minamijoyo minamijoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve also confirmed that this works with a real gcs bucket. LGTM 👍

@minamijoyo minamijoyo merged commit 0624d40 into minamijoyo:master Aug 25, 2022
@minamijoyo minamijoyo changed the title Support GCS history backend (simpler version) Support GCS as a history storage Aug 25, 2022
@KengoTODA KengoTODA deleted the expose-gcs-storage branch August 25, 2022 14:31
@KengoTODA
Copy link
Contributor Author

Thank you!

@minamijoyo
Copy link
Owner

@KengoTODA I've just released it in v0.3.7 🚀 Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants