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

Apply defaults to terraform_remote_state if state file doesn't exist #22211

Open
edahlseng opened this issue Jul 25, 2019 · 5 comments
Open

Apply defaults to terraform_remote_state if state file doesn't exist #22211

edahlseng opened this issue Jul 25, 2019 · 5 comments

Comments

@edahlseng
Copy link

Current Terraform Version

Terraform v0.12.5

Use-cases

I have a project that uses the terraform_remote_state resource. When bootstrapping the project, however, the remote state file that it targets doesn't exist. I've added defaults to the resource to work against this, however Terraform still complains with Error: Unable to find remote state.

Attempted Solutions

During the bootstrapping project, I currently comment out the terraform_remote_state resource, and then replace all of the resource interpolations with the defaults values directly. This works, but is a little cumbersome.

Proposal

My original intuition with terraform_remote_state was that the defaults would apply, even if the remote state file didn't exist. If this was possible, I think it would make this workflow much smoother!

References

As far as I know, there aren't any related GitHub issues.

@bendavies
Copy link

I also need this, as my terraform_remote_state key is optional. it may or may not exist.

@willgleich
Copy link

I wonder if it is possible to add a fail_silently variable so this doesn't remain toil for anyone who wants to leverage coming state in larger terraform repositories. Similarly to how try and can work.

@SimCo92
Copy link

SimCo92 commented Dec 15, 2021

Did someone found a workaround to this?

@wholien
Copy link

wholien commented Aug 16, 2023

Bumping here - anyone have solutions/workarounds for this?

@legioner0
Copy link

legioner0 commented Nov 24, 2023

Same problem on v1.6.3 with S3 backend

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

No branches or pull requests

6 participants