TIL: `pulumi import` doesn't just create code for ...
# python
pulumi import
doesn't just create code for an existing resource, it also imports that existing physical resource into your current stack. So if you are trying to use
to learn how to make a similar resources, beware. Because your dev stack will get a reference to the actual real infra that's in use. And if you're like me you won't understand why your dev stack has this thing you never created with
pulumi up
and when you finally succeed in getting it out of your stack, you take down the system. :(
Is there a way to generate the code for an existing resource without actually adding it to the stack?
https://github.com/pulumi/pulumi/issues/8836 It's tricker to support then one would hope due to some strange internals so hasn't been priortised
We generally suggest just doing imports in a throw away stack if you just need the codegen and
stack rm
the whole stack after