Is there any way to tell Pulumi that a resource wa...
# general
i
Is there any way to tell Pulumi that a resource was created w/o creating that resource? The Pulumi script creates an ALB as a side-effect and it doesn't get deleted when doing a
pulumi destroy
. I've done dependencies, I've tried delays, nothing works. So I'm looking at this as my last resort.
w
Is this an ALB allocated by Kubernetes by chance? One thing you could try to do (I've never done this myself - but I expect it could work) is to
import
the resource - so that it does get registered in the Pulumi stack, and will get deleted by Pulumi when destroyed - but will adopt the existing resource instead of creating a new one during "up". This requires knowing how to find the id of the resource after it is created programmatically - but that may be possible in this case?
c
What are you using to create the ALB? When I was using AWS, we were using the alb-ingress-controller which automatically deleted the ALB whenever the Service was removed.
i
we're using alb-ingress-controller but during the destroy the controller is deleted too fast to notice and act on the ingress destruction (at least that's my current theory).
and i'm not sure what is meant by 'import'ing the resource.
w
I'm not actually sure it will work - but you can see https://www.pulumi.com/blog/adopting-existing-cloud-resources-into-pulumi/.
i
That's very useful. Thanks for that. I think I'm going to take another approach though of using a separate project. I'm pretty sure that will work - though I'll test it to make sure. Thanks again.
c
Curious, why is the controller in the same stack as your application?