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

Allow WalkResources to walk all resources (of all types) if resourceType not specified #142

Closed
wants to merge 1 commit into from

Conversation

eczy-tempus
Copy link

Modifies the WalkResources function such that if resourceType is passed the string zero-value "", the function walks over all resources of all types.

@wata727
Copy link
Member

wata727 commented Feb 6, 2022

Hi @eczy-tempus, thank you for your contribution.
Now I'm working on a major update to the SDK and the current APIs, including WalkResources, will change significantly #135

If this change isn't urgently needed, I recommend waiting for a new version to be released. If you would like to take advantage of this change immediately, please let me know. Thanks.

@eczy-tempus
Copy link
Author

@wata727 This change isn't urgently needed. I've already implemented an external function that achieves the same functionality. The purpose of this PR is to add the ability to access all resources (regardless of type) to this library in case others have similar requirements.

It appears that in #135 this would be possible like so:

providers, _ := runner.GetModuleContent(&hclext.BodySchema{
    Blocks: []hclext.BlockSchema{
        {
            Type: "resource",
            ...
        },
    },
}, nil)

Is this correct? If so, then this functionality will have already been implemented, and I can close this PR.

@wata727
Copy link
Member

wata727 commented Feb 8, 2022

Yes, in the new SDK version, that example works correctly.
I currently investigating compatibility in edge cases. Please wait a moment.

@eczy-tempus
Copy link
Author

@wata727 Closing this PR since this functionality will be covered in an upcoming release. Thank you for your hard work in maintaining this tool!

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

Successfully merging this pull request may close these issues.

2 participants