https://pulumi.com logo
#typescript
Title
# typescript
b

bland-camera-22041

08/12/2019, 1:33 PM
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
b

boundless-monkey-50243

08/12/2019, 2:21 PM
I've never really used the Pulumi read methods, but don't they just return a
Promise
?