https://pulumi.com logo
#aws
Title
# aws
w

wooden-action-47328

03/06/2024, 4:44 PM
Is there a correct way to completely remove a stack from the S3 remote backend state? It looks like
pulumi stack rm
still leaves some configuration files behind
l

little-cartoon-10569

03/06/2024, 7:50 PM
Which files? You shouldn't see the stack if you run
pulumi stack ls
.
w

wooden-action-47328

03/06/2024, 7:52 PM
There are configuration files on the remote state bucket from stacks that have been deleted
l

little-cartoon-10569

03/06/2024, 7:52 PM
Presumably they're not in use. You can tidy them up.
w

wooden-action-47328

03/06/2024, 7:53 PM
But there’s no way to get pulumi to clean this up by itself?
l

little-cartoon-10569

03/06/2024, 7:54 PM
I don't know. I don't have enough information. What files?
But: probably not.
pulumi stack rm
is the final word, as far as I know.
w

wooden-action-47328

03/06/2024, 8:06 PM
There’s a bunch of stuff in .pulumi, backups, meta.yaml, and stack info
I don’t know exactly, but it looks like some of these things clearly belong to a stack that was deleted
l

little-cartoon-10569

03/06/2024, 8:07 PM
~/.pulumi is local, and different for everyone who uses the (shared!) stack. It can't be cleaned up. If you delete the stack, Pulumi can't turn on my machine and delete my metadata files.... even though I'd deployed the stack a few times.
w

wooden-action-47328

03/06/2024, 8:07 PM
it’s a .pulumi folder on the remote s3 bucket
l

little-cartoon-10569

03/06/2024, 8:07 PM
That's local.
w

wooden-action-47328

03/06/2024, 8:08 PM
how is that local?
l

little-cartoon-10569

03/06/2024, 8:08 PM
It's the ~/.pulumi for that instance. You have another ~/.pulumi in your instance, and the CI machine has one, and your other team members have one.. etc.
I don't me "here" local, I mean "specific to this instance" local.
w

wooden-action-47328

03/06/2024, 8:09 PM
I don’t understand what that means in the context of S3. It’s not local to anything running pulumi, it’s just a remote state repository
l

little-cartoon-10569

03/06/2024, 8:12 PM
I'm not au fait with all the details, but that directory exists with different files for everyone who has used that project / state. It exists on my machine even though I don't use S3 as a backend, I use the Pulumi app. You'd need someone with more information to figure out if all the data that can be delete is being deleted. But generally: don't worry about the contents of ~/.pulumi, they're just implementation details.