https://pulumi.com logo
#general
Title
# general
i

incalculable-engineer-92975

10/03/2019, 4:11 PM
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

white-balloon-205

10/03/2019, 4:31 PM
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

cool-egg-852

10/03/2019, 5:03 PM
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

incalculable-engineer-92975

10/03/2019, 5:45 PM
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

white-balloon-205

10/03/2019, 6:07 PM
I'm not actually sure it will work - but you can see https://www.pulumi.com/blog/adopting-existing-cloud-resources-into-pulumi/.
i

incalculable-engineer-92975

10/03/2019, 6:19 PM
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

cool-egg-852

10/03/2019, 7:06 PM
Curious, why is the controller in the same stack as your application?