https://pulumi.com logo
#general
Title
# general
h

hallowed-cpu-30324

03/02/2022, 9:32 AM
How to use the command line to list the resources currently managed by pulumi
e

echoing-dinner-19531

03/02/2022, 10:30 AM
pulumi stack ls --all | awk '{print $1}' | tail +2 | xargs -L1 pulumi stack export --stack | jq ".deployment.resources[]? | {urn: .urn}"
Will print something like:
Copy code
{
  "urn": "urn:pulumi:test2::aws-ts-eks::pulumi:providers:aws::default_4_31_0"
}
{
  "urn": "urn:pulumi:p-it-ibasa-pc-digitaloce-f3cc20e8::digitalocean-ts-loadbalanced-droplets::pulumi:providers:digitalocean::default_4_11_1"
}
{
  "urn": "urn:pulumi:aegddxvk::exception_inline_node::pulumi:pulumi:Stack::exception_inline_node-aegddxvk"
}
We don't have anything built into the CLI to do this iteration, but as you can see you can just pipe into CLI tools to do it pretty simply
h

hallowed-cpu-30324

03/03/2022, 1:47 PM
Thanks
5 Views