https://pulumi.com logo
Title
b

bumpy-laptop-30846

10/27/2022, 10:00 AM
Hello, is it possible to know if a ressource actually exists when doing a preview? I am using typescript, but the question applies to all sdk’s I imagine.
e

echoing-dinner-19531

10/27/2022, 10:06 AM
Maybe if there's an invoke for it, what resource are you trying to check for?
b

bumpy-laptop-30846

10/27/2022, 11:31 AM
It’s an eks cluster from
@pulumi/eks
Is there a way to get the ressources that are already in the stack?
e

echoing-dinner-19531

10/27/2022, 11:38 AM
Well if there already in the stack then preview will know about them? I'm a bit confused as to what your asking for here.
b

bumpy-laptop-30846

10/27/2022, 12:01 PM
actually I am doing a preview of a program already ran, there is new code in this pulumi program. So I would like to know if a specific resource was already there in the stack. I need to know this in the program itself
e

echoing-dinner-19531

10/27/2022, 12:41 PM
Check it's ID
If you put the code that needs that resource to exist inside an ID.Apply it will only run if the ID resolves