Skip to content
Latchkey

Pulumi "deleting ... resource ... still has dependents" in CI

Pulumi refused to delete a resource because other resources still depend on it. Removing it would leave the dependents referencing something that no longer exists, so the delete is blocked until the dependents are handled.

What this error means

A pulumi up or pulumi destroy step fails with "error: deleting resource 'X': ... still has dependents" and lists the URNs that depend on it.

pulumi
error: deleting urn:pulumi:dev::app::aws:ec2/vpc:Vpc::main:
resource still has dependents:
	urn:pulumi:dev::app::aws:ec2/subnet:Subnet::app-subnet

Common causes

Dependent resources are not being deleted together

The program still declares resources that reference the one you removed, so Pulumi cannot delete it while they exist.

A manual state edit left a dangling dependency

A partial state change removed a resource without removing what depends on it, leaving an inconsistent graph.

How to fix it

Remove or repoint the dependents first

  1. Identify the dependent URNs listed in the error.
  2. Delete or update those resources so they no longer reference the target.
  3. Re-run so the target can be removed.

Delete the dependent from state if it is truly gone

If a dependent no longer exists in the cloud, remove it from state so the parent can be deleted.

Terminal
pulumi state delete 'urn:pulumi:dev::app::aws:ec2/subnet:Subnet::app-subnet'

How to prevent it

  • Delete resources through the program so dependency order is respected.
  • Avoid manual state edits that leave dangling dependents.
  • Model parent/child relationships explicitly so ordering is correct.

Frequently asked questions

What causes ""still has dependents""?
The program still declares resources that reference the one you removed, so Pulumi cannot delete it while they exist.
How do I fix "still has dependents"?
Remove or repoint the dependents first

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card