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

green-oxygen-75202

06/21/2023, 8:28 AM
Hi, i can easily
pulumi destroy
pulumi stacks with Pulumi CLI that were originally created with Pulumi CLI (which have a Pulumi.yaml file on the file system). Now i try to do the same for stacks that were originally created using the Pulumi Automation API (which do not have Pulumi.yaml files on the file system), but this does not seem to work. It complains about seraching for and not finding a Pulumi.yaml file in parent directories. The thing is that i succesfully CAN
pulumi rm
stacks with Pulumi CLI that were originally created with the Pulumi Automation API. But of course that leaves the Pulumi Resources "orphaned" since
pulumi rm
does not destroy the resources itself, but only the Pulumi state in Pulumi Cloud. So what i would like to achieve is to be able to
pulumi destroy
resources with Pulumi CLI that were originally cretated using the Pulumi Automation API. Is this implemented or on the roadmap?
m

miniature-musician-31262

06/21/2023, 9:59 AM
It should be possible to destroy any stack by passing the
--stack
(or
-s
) option — for example,
pulumi destroy -s myorg/myproject/mystack
. Have you tried this?
g

green-oxygen-75202

06/21/2023, 10:01 AM
yes i tried that but it still try to find a Pulumi.yaml which does not exist on the file system since the *s*tack was created with the Pulumi Automation API
m

miniature-musician-31262

06/21/2023, 10:04 AM
Are you using the Pulumi Cloud backend or a self-managed one? (I don’t think this should matter, but worth asking nonetheless.)
g

green-oxygen-75202

06/21/2023, 10:06 AM
Using Pulumi Cloud. Seems that Pulumi CLI needs a Pulumi.yaml in order to do
pulumi destroy -s
, while it does NOT need a Pulumi.yaml to do
pulumi rm -s
on stacks that were originally created with Pulumi Automation API
m

miniature-musician-31262

06/21/2023, 10:09 AM
Are you running the command from a directory that is a descendant of a directory containing a Pulumi.yaml file? I think I’ve seen that there’s a quirk in the CLI behavior where running this command will fail when run within a non-matching project dir.
g

green-oxygen-75202

06/21/2023, 10:12 AM
Ah ok, indeed, i ran it from a deep directory that had Pulumi.yaml somewhere in an ancesstor directory... I 'll try to run it from a Pulumi agnostic folder...