import * as aws from "@pulumi/aws" ; import * as pulumi from "@pulumi/pulumi" ; import * as x from ".." ; import * as utils from "../utils" ; export class InternetGateway extends pulumi . ComponentResource implements x . ec2 . SubnetRouteProvider { public readonly vpc : x . ec2 . Vpc ; public readonly internetGateway : aws . ec2 . InternetGateway ; constructor ( name , vpc , args , opts ? ) ; constructor ( name , vpc , args , opts ? ) ; constructor ( name , vpc , args , opts = { } ) { super ( "awsx:x:ec2:InternetGateway" , name , { } , { parent : vpc , ... opts } ) ; this . vpc = vpc ; if ( isExistingInternetGatewayArgs ( args ) ) { this . internetGateway = args . internetGateway ; } else { this . internetGateway = new aws . ec2 . InternetGateway ( name , { ... args , vpcId : vpc . id , } , { parent : this } ) ; } this . registerOutputs ( ) ; } public route ( name , opts ) { return { destinationCidrBlock : "0.0.0.0/0" , gatewayId : this . internetGateway . id , } ; } } export interface ExistingInternetGatewayArgs { /**
     * Optional existing instance to use to make the [awsx.ec2.InternetGateway] out of.
     */ internetGateway : aws . ec2 . InternetGateway ; } function isExistingInternetGatewayArgs ( obj ) { return ! ! ( < ExistingInternetGatewayArgs > obj ) . internetGateway ; }