Thread
#general
    b

    breezy-book-15761

    4 weeks ago
    Hello, is there a way to tell pulumi that you want to delete something?
    s

    steep-toddler-94095

    4 weeks ago
    you can delete something by having your code not generate that resource anymore
    b

    breezy-book-15761

    4 weeks ago
    yeah the thing is that it's not a resource I created
    it's an automatically created resource, and I want to remove it
    s

    steep-toddler-94095

    4 weeks ago
    if it's not tracked in Pulumi state, then pulumi cannot delete it Let's say you had Pulumi create a k8s Service and creates a corresponding ALB. You can "have Pulumi delete" the ALB by changing your Service to not be associated with a Cloud LB, but it's not Pulumi that's deleting the resource - it's whatever integration that created the resource in the first place.
    b

    breezy-book-15761

    4 weeks ago
    yeah exactly but not possible here
    would be great though
    that way I could get out of ansible for this use case
    l

    little-cartoon-10569

    3 weeks ago
    You can do it by importing the resource but not adding the generated code to your code base. That will put the resource in state; when you next run
    up
    , Pulumi will see the difference and remove the resource.
    You can even do it in a reusable dummy project with a stack but no resources. It would work with any resource that can be imported.