UNPKG

@pulumi/aws-native

Version:

The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)

93 lines 5.48 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Route = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Specifies a route in a route table. For more information, see [Routes](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html#route-table-routes) in the *Amazon VPC User Guide*. * You must specify either a destination CIDR block or prefix list ID. You must also specify exactly one of the resources as the target. * If you create a route that references a transit gateway in the same template where you create the transit gateway, you must declare a dependency on the transit gateway attachment. The route table cannot use the transit gateway until it has successfully attached to the VPC. Add a [DependsOn Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) in the ``AWS::EC2::Route`` resource to explicitly declare a dependency on the ``AWS::EC2::TransitGatewayAttachment`` resource. */ class Route extends pulumi.CustomResource { /** * Get an existing Route resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, opts) { return new Route(name, undefined, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Route. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Route.__pulumiType; } /** * Create a Route resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name, args, opts) { let resourceInputs = {}; opts = opts || {}; if (!opts.id) { if (args?.routeTableId === undefined && !opts.urn) { throw new Error("Missing required property 'routeTableId'"); } resourceInputs["carrierGatewayId"] = args?.carrierGatewayId; resourceInputs["coreNetworkArn"] = args?.coreNetworkArn; resourceInputs["destinationCidrBlock"] = args?.destinationCidrBlock; resourceInputs["destinationIpv6CidrBlock"] = args?.destinationIpv6CidrBlock; resourceInputs["destinationPrefixListId"] = args?.destinationPrefixListId; resourceInputs["egressOnlyInternetGatewayId"] = args?.egressOnlyInternetGatewayId; resourceInputs["gatewayId"] = args?.gatewayId; resourceInputs["instanceId"] = args?.instanceId; resourceInputs["localGatewayId"] = args?.localGatewayId; resourceInputs["natGatewayId"] = args?.natGatewayId; resourceInputs["networkInterfaceId"] = args?.networkInterfaceId; resourceInputs["routeTableId"] = args?.routeTableId; resourceInputs["transitGatewayId"] = args?.transitGatewayId; resourceInputs["vpcEndpointId"] = args?.vpcEndpointId; resourceInputs["vpcPeeringConnectionId"] = args?.vpcPeeringConnectionId; resourceInputs["cidrBlock"] = undefined /*out*/; } else { resourceInputs["carrierGatewayId"] = undefined /*out*/; resourceInputs["cidrBlock"] = undefined /*out*/; resourceInputs["coreNetworkArn"] = undefined /*out*/; resourceInputs["destinationCidrBlock"] = undefined /*out*/; resourceInputs["destinationIpv6CidrBlock"] = undefined /*out*/; resourceInputs["destinationPrefixListId"] = undefined /*out*/; resourceInputs["egressOnlyInternetGatewayId"] = undefined /*out*/; resourceInputs["gatewayId"] = undefined /*out*/; resourceInputs["instanceId"] = undefined /*out*/; resourceInputs["localGatewayId"] = undefined /*out*/; resourceInputs["natGatewayId"] = undefined /*out*/; resourceInputs["networkInterfaceId"] = undefined /*out*/; resourceInputs["routeTableId"] = undefined /*out*/; resourceInputs["transitGatewayId"] = undefined /*out*/; resourceInputs["vpcEndpointId"] = undefined /*out*/; resourceInputs["vpcPeeringConnectionId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const replaceOnChanges = { replaceOnChanges: ["destinationCidrBlock", "destinationIpv6CidrBlock", "destinationPrefixListId", "routeTableId"] }; opts = pulumi.mergeOptions(opts, replaceOnChanges); super(Route.__pulumiType, name, resourceInputs, opts); } } exports.Route = Route; /** @internal */ Route.__pulumiType = 'aws-native:ec2:Route'; //# sourceMappingURL=route.js.map