@echoing-dinner-19531 yeah, I think this is a really import feature because sometimes writing code is harder than using the console to create a resource, We can generate basic code in this way. To be honest, this was inspired by
kubectl create deploy xxx --dry-run -o yaml
I don’t think it would be too difficult to implement this feature on a current basis. Are you willing to accept open-source contributions? I want to try if possible🤣
orange-airport-64592
08/03/2023, 2:58 AM
@echoing-dinner-19531 I knew this “hack” way, but this is not my purpose
e
echoing-dinner-19531
08/03/2023, 6:32 AM
We're open to contributions, I think the internal code makes this trickier than first expected. I think the easiest way to do this would to just do the hack but internally (and a little better).
Basically if --generate-only is set then make a filestate backend pointing to a temp folder and a stack in it called "import" then run the rest of the import logic as usual.
But if you have a look and see another clean way to do this, then by all means submit a PR I'll take a look.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.