@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.79 kB
JavaScript
;
// *** 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, Object.assign(Object.assign({}, 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 || args.routeTableId === undefined) && !opts.urn) {
throw new Error("Missing required property 'routeTableId'");
}
resourceInputs["carrierGatewayId"] = args ? args.carrierGatewayId : undefined;
resourceInputs["coreNetworkArn"] = args ? args.coreNetworkArn : undefined;
resourceInputs["destinationCidrBlock"] = args ? args.destinationCidrBlock : undefined;
resourceInputs["destinationIpv6CidrBlock"] = args ? args.destinationIpv6CidrBlock : undefined;
resourceInputs["destinationPrefixListId"] = args ? args.destinationPrefixListId : undefined;
resourceInputs["egressOnlyInternetGatewayId"] = args ? args.egressOnlyInternetGatewayId : undefined;
resourceInputs["gatewayId"] = args ? args.gatewayId : undefined;
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["localGatewayId"] = args ? args.localGatewayId : undefined;
resourceInputs["natGatewayId"] = args ? args.natGatewayId : undefined;
resourceInputs["networkInterfaceId"] = args ? args.networkInterfaceId : undefined;
resourceInputs["routeTableId"] = args ? args.routeTableId : undefined;
resourceInputs["transitGatewayId"] = args ? args.transitGatewayId : undefined;
resourceInputs["vpcEndpointId"] = args ? args.vpcEndpointId : undefined;
resourceInputs["vpcPeeringConnectionId"] = args ? args.vpcPeeringConnectionId : undefined;
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