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

Backend type gcs is not supported referencing remote tfstate #38

Closed
andrewnazarov opened this issue Oct 29, 2020 · 5 comments
Closed

Backend type gcs is not supported referencing remote tfstate #38

andrewnazarov opened this issue Oct 29, 2020 · 5 comments

Comments

@andrewnazarov
Copy link
Contributor

After #34 was improved I've finally had a chance to test remote backend when referencing tfstate again, and now I see the real error instead of panic:

err: expand tfstate:////builds/devops/k8s/shared-services/helmfile-shared-services-staging/.terraform/terraform.tfstate/output.external-ip.value: reading tfstate for /builds/devops/k8s/shared-services/helmfile-shared-services-staging/.terraform/terraform.tfstate/output.external-ip.value: backend type gcs is not supported
changing working directory back to "/builds/devops/k8s/shared-services/helmfile-shared-services-staging"
in ./helmfile.yaml: in .helmfiles[0]: in /builds/devops/k8s/shared-services/helmfile-shared-services-staging/.helmfile/cache/https_my_domain_com_my_project_k8s_shared-services_helmfile-common_git.ref=v0.37/helmfile.yaml: expand tfstate:////builds/devops/k8s/shared-services/helmfile-shared-services-staging/.terraform/terraform.tfstate/output.external-ip.value: reading tfstate for /builds/devops/k8s/shared-services/helmfile-shared-services-staging/.terraform/terraform.tfstate/output.external-ip.value: backend type gcs is not supported

In my helmfile I'm setting this the following way:

...
service:
  loadBalancerIP: {{- if ne .Environment.Name "default" }} ref+tfstate:///{{ env "PATH_TO_TF_STATE" }}/output.external-ip.value {{- end }}
...

and in CI I'm just doing:

...
export PATH_TO_TF_STATE=$(pwd)/.terraform/terraform.tfstate
...

Haven't checked on a plain vals though, I'm using it as a part of helmfile

HELMFILE_VERSION=v0.130.0
@mumoshu
Copy link
Collaborator

mumoshu commented Oct 29, 2020

@andrewnazarov Thanks for the update! Turns out the package "tfstate-lookup" which vals uses for querying tfstate doesn't support the GCS backend yet:

https://github.com/fujiwara/tfstate-lookup/blob/6da1fba26ab4944e2df09ff549a8f6f9812abae8/tfstate/remote.go#L18

Looks like we'd better contribute it 😃

@andrewnazarov
Copy link
Contributor Author

As a first step, I've opened an issue:)
fujiwara/tfstate-lookup#13

@dex4er
Copy link
Contributor

dex4er commented Apr 24, 2021

Hi. I made fujiwara/tfstate-lookup#21 and I hope it will be accepted by project owner.

@mumoshu
Copy link
Collaborator

mumoshu commented May 3, 2021

@andrewnazarov @dex4er Can this be safely closed since #47 and #49 have been merged?

@andrewnazarov
Copy link
Contributor Author

Yes, sure. Thanks for the 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

No branches or pull requests

3 participants