Hi, i can easily `pulumi destroy` pulumi stacks wi...
# general
g
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
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
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
Are you using the Pulumi Cloud backend or a self-managed one? (I don’t think this should matter, but worth asking nonetheless.)
g
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
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
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...