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

Return error for non-existent resources when using terraformless export #560

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented Sep 4, 2024

Previously, when using terraformless export (i.e. -tfclient-plugin-path), if the resource/resource group to be exported doesn't exit, an empty HCL block will still be generated.

This PR adds additional check after the ReadResource RPC call, to raise error if the state read is nil. This logic exists in terraform (@internal/terraform/node_resource_import.go), that's why terraform export will correctly raise the error for non-existent resources.

@ziyeqf ziyeqf self-requested a review September 4, 2024 02:53
@magodo magodo merged commit ee37f13 into Azure:main Sep 4, 2024
6 of 7 checks passed
@magodo magodo added the bug Something isn't working label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants