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

cold-orange-37453

01/23/2024, 10:02 AM
Hello everyone & @echoing-match-29901, I am using pulumi to create infra on AWS in my organisation. I am using golang SDK with it. In the pulumi code, I have created a resource, which already existed before. When I try to run this code it fails with error “AlreadyExists”. I wanted to ask if there exists any such solution currently using pulumi, such that i can programatically ignore some errors such that rest of the execution still runs. Assume that it is not possible for me to currently either import it or delete it and create via Pulumi or edit the state files manually to ignore any diff.
s

steep-pager-59220

01/23/2024, 10:05 AM
I think you should be able to use
pulumi import
to import the resources so pulumi knows they already exist properly.
c

cold-orange-37453

01/23/2024, 10:20 AM
Thanks for the fast reply @steep-pager-59220
@steep-pager-59220 Are there any plans on adding this feature anytime soon to Pulumi ? i.e ignore some kind of errors programatically
s

steep-pager-59220

01/23/2024, 10:31 AM
I'm not aware of it personally.
l

little-cartoon-10569

01/23/2024, 7:03 PM
That's not a Pulumi issue. That's a lanugage issue. You can try/catch in the normal way. In this case, instead of attempting to create a new copy of something that already exists, your choices are either to import the resource first, so that it is managed in Pulumi, or to check if it exists first, then either create it or use the existing. Attempting to create then handling the error isn't the correct solution.