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

[feature] Direct support of referencing tfstate files in s3 buckets #45

Closed
recollir opened this issue Mar 16, 2021 · 1 comment
Closed

Comments

@recollir
Copy link

recollir commented Mar 16, 2021

Right now one needs to reference to the local file containing the s3 reference

Remote backends like S3 is also supported. When a remote backend is used in your terraform workspace, there should be a local file at ./terraform/terraform.tfstate that contains the reference to the backend.

Since that file might live in different directories for different developers and might not be available at all in a ci/cd environment it would be nice to be able to refer to the S3 backend directly from with in the reference. As tfstate-lookup also supports direct lookup in S3 buckets like in

tfstate-lookup -s s3://name-of-s3-bucket/path/to/the/tfstatefile aws_route53_record.foo_db_public_record_bar.name

So something like

echo 'foo: ref+s3tfstate://name-of-s3-bucket/path/to/the/tfstatefile#/aws_route53_record.foo_db_public_record_bar.name' | vals eval -f -

would be nice to have. Would it even be possible to add the aws profile that should be used for this? And have vals do the 'magic' of accessing it?

echo 'foo: ref+s3tfstate://name-of-s3-bucket/path/to/the/tfstatefile?profile=name-of-aws-profile#/aws_route53_record.foo_db_public_record_bar.name' | vals eval -f -

@aston-r
Copy link

aston-r commented Apr 14, 2021

I also interested in this feature. I use terragrunt with remote state and I can no specify the path to tfstatefile, since the terragrunt stores it in the tmp folder that is dynamic....

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

2 participants