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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple import and skeleton code generation #16422

Open
rulatir opened this issue Jun 19, 2024 · 1 comment
Open

Decouple import and skeleton code generation #16422

rulatir opened this issue Jun 19, 2024 · 1 comment
Labels
area/import kind/enhancement Improvements or new features

Comments

@rulatir
Copy link

rulatir commented Jun 19, 2024

Hello!

  • Vote on this issue by adding a 馃憤 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Currently the ability to generate skeleton code for the imported resources is tied to the import command. I would like these functionalities to be decoupled.

Affected area/feature

As a gradual / iterative / trial-and-error adopter / learner, I would like to be able to generate and re-generate the skeleton code repeatedly for arbitrary subsets of resources specified with -f. Currently the only way to do this is with pulumi import, but pulumi import is primarily concerned with importing the resources into the state, only adding the code generation as an afterthought. One consequence of this is the fact that the exit status of pulumi import is tied to the success of the import operation, and will be unsuccessful if the import fails as a whole or in part because of repetition, even if the code generation succeeds. This makes it much harder to use pulumi import as a code generator in a build system, because when it is invoked for the purpose of generating code, it can sometimes "fail" even if code generation succeds, tripping the build system.

I would like to have pulumi generate that can read the same resource specification JSON as pulumi import -f, but its exit status (as well as any warnings displayed) would be tied to the success of generating the code rather than that of the import operation.

Wrapping pulumi and ignoring the exit status is not the solution: pulumi must still be able to meaningfully fail to generate code. I am also a firm believer in Thou Shalt Not Parse Natural Language, so grepping English error messages from pulumi import does not enter into consideration.

@rulatir rulatir added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Jun 19, 2024
@justinvp justinvp added area/import and removed needs-triage Needs attention from the triage team labels Jun 21, 2024
@justinvp
Copy link
Member

Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/import kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants