Hello folks, does anyone know how to fetch all res...
# general
b
Hello folks, does anyone know how to fetch all resource urns in current stack through pulumi API, just like
pulumi stack --show-urns
does, but through the code?
f
I don't think there's a straightforward way of doing that in the code itself. You can add stack outputs to all your resources to output the URN although I know this may be tedious if you have a ton of resources. This is a bit hacky but depending on your situation you might be able to execute the
pulumi stack export
command in the programming language of your choice and parse the output to get all URNs.