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

Extract nested json value via variable #129

Open
derekleegh opened this issue Jan 17, 2025 · 0 comments
Open

Extract nested json value via variable #129

derekleegh opened this issue Jan 17, 2025 · 0 comments

Comments

@derekleegh
Copy link

derekleegh commented Jan 17, 2025

Hi,

I have a unique use case here if I can get your advice on what is the best approach.

Based on your example on README.md, I would like to extract the db and get the value as a json.

value = {"password": "bar"}

It works with your jsondecode(data.sops_file.demo-secret.raw).db

How can i pass the .db as an variable?

What i want to achieve is something like this: jsondecode(data.sops_file.demo-secret.raw)[var.key] where var.key is '.db'

The idea is that the key we want to extract can be a variable without hardcoding the .db

Hope you can help me with this use case.

Thanks

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

1 participant