https://pulumi.com logo
Title
d

delightful-monkey-90700

02/15/2023, 9:35 PM
I have a resource which has dependencies and
deleteBeforeReplace
, if that resource needs to replaced the dependencies must also be deleted (because they depend on the parent resource, and the parent resource can't be deleted while they exist) -- this isn't what happens though and the resource can't be deleted, and thus can't be replaced
s

strong-helmet-83704

02/15/2023, 9:55 PM
Can you over-ride the setting on the parent resources? (or explicitly define parent/child?)
d

delightful-monkey-90700

02/15/2023, 11:16 PM
What do you mean over-ride the setting ?
It's a Subnet that needs to be replaced for a VPC and it can't do that if there are VMs associated with it still running -- the VMs parent is already the Subnet Pulumi object -- there's no setting to change here.
s

strong-helmet-83704

02/15/2023, 11:49 PM
Separate to any definable or ‘soft’ pulumi relationships or dependencies, you just cannot delete a subnet before you delete everything within it. If you’re OK with doing that… and all the resources are managed by your stack, if they are all set to be children of the parent, and the parent is deleted… it should delete everything.
e

echoing-dinner-19531

02/16/2023, 1:12 PM
Can you raise issue on our github about this. It might be there's a way to work around this already, but you might need a new setting to override the delete when a dependee resource is deleted logic in replace.
d

delightful-monkey-90700

02/16/2023, 3:28 PM
I can workaround it by manually calling
destroy
on the resources easily enough.
It looks really similar to this issue: https://github.com/pulumi/pulumi/issues/11273
I also added a comment with the details of my stack: https://github.com/pulumi/pulumi/issues/11273#issuecomment-1433290490
(the workaround is just
pulumi destroy --target '**:prod-mgmt-subnet' --target '**:prod-tunnel-subnet' --target-dependents
, doing it as a delete does things in the right order)