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

Be able to use a glob pattern for state in --from argument #316

Closed
eliecharra opened this issue Mar 5, 2021 · 1 comment
Closed

Be able to use a glob pattern for state in --from argument #316

eliecharra opened this issue Mar 5, 2021 · 1 comment
Assignees
Labels
kind/enhancement New feature or improvement priority/2
Milestone

Comments

@eliecharra
Copy link
Contributor

Description
We want to be able to pass a more complex expression to filter states files for local and s3 state.

We can use a Glob expression matching logic.

Example

driftctl scan --from tfstate+s3://my-bucket/my-path/**/*.tfstate

References

@eliecharra eliecharra added kind/enhancement New feature or improvement priority/3 labels Mar 5, 2021
@moadibfr moadibfr self-assigned this Mar 11, 2021
@sjourdan sjourdan added this to the v0.8.0 milestone Mar 19, 2021
@eliecharra eliecharra assigned sundowndev and unassigned moadibfr Apr 12, 2021
@sundowndev sundowndev assigned sjourdan and unassigned sundowndev May 7, 2021
@sjourdan
Copy link
Contributor

sjourdan commented May 7, 2021

LGTM!

I confirm that I could request only for *.walou (file states/2/terraform.walou) and that others like file states/3/terraform.yaddi or states/1/terraform.tfstate were not picked up.

❯  LOG_LEVEL=error driftctl-0.8.0 scan --from tfstate://**/*.walou
Scanned states (1) 
Scanned resources (54)      

And also that if I have 2 *.yaddi statefiles the counter is incremented and no other file is used.

❯  LOG_LEVEL=error driftctl-0.8.0 scan --from tfstate://states/**/*.yaddi
Scanned states (2) 
[...]

A small bug related to a folder was found but I'll open a separate issue for this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or improvement priority/2
Projects
None yet
Development

No branches or pull requests

4 participants