Hey, Wondered if anyone new a way to actually capt...
# general
b
Hey, Wondered if anyone new a way to actually capture errors from pulumi
Copy code
try{
      NatGw = aws.ec2.getNatGateway({
        tags: {
          Name: "RCS-CDR"
        }
      });
    } catch(err){
      // Craete a New NAT GW here ... 
    }
The error is not caught but it's thrown in my terminal after pulumi up. I'd like to catch the error and create a new resource if the gatway with the name
RCS-CDR
does not exist
🍿 1
w
This is being tracked in https://github.com/pulumi/pulumi-terraform/issues/262. The intention is that this should throw so that you can use try/catch. But currently it just returns a result with an undefined id.