UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

102 lines 4.09 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"); /** * Manages an EC2 Transit Gateway Route. * * ## Example Usage * * ### Standard usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2transitgateway.Route("example", { * destinationCidrBlock: "0.0.0.0/0", * transitGatewayAttachmentId: exampleAwsEc2TransitGatewayVpcAttachment.id, * transitGatewayRouteTableId: exampleAwsEc2TransitGateway.associationDefaultRouteTableId, * }); * ``` * * ### Blackhole route * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2transitgateway.Route("example", { * destinationCidrBlock: "0.0.0.0/0", * blackhole: true, * transitGatewayRouteTableId: exampleAwsEc2TransitGateway.associationDefaultRouteTableId, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_ec2_transit_gateway_route` using the EC2 Transit Gateway Route Table, an underscore, and the destination. For example: * * ```sh * $ pulumi import aws:ec2transitgateway/route:Route example tgw-rtb-12345678_0.0.0.0/0 * ``` */ 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 state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new Route(name, state, { ...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; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["blackhole"] = state?.blackhole; resourceInputs["destinationCidrBlock"] = state?.destinationCidrBlock; resourceInputs["region"] = state?.region; resourceInputs["transitGatewayAttachmentId"] = state?.transitGatewayAttachmentId; resourceInputs["transitGatewayRouteTableId"] = state?.transitGatewayRouteTableId; } else { const args = argsOrState; if (args?.destinationCidrBlock === undefined && !opts.urn) { throw new Error("Missing required property 'destinationCidrBlock'"); } if (args?.transitGatewayRouteTableId === undefined && !opts.urn) { throw new Error("Missing required property 'transitGatewayRouteTableId'"); } resourceInputs["blackhole"] = args?.blackhole; resourceInputs["destinationCidrBlock"] = args?.destinationCidrBlock; resourceInputs["region"] = args?.region; resourceInputs["transitGatewayAttachmentId"] = args?.transitGatewayAttachmentId; resourceInputs["transitGatewayRouteTableId"] = args?.transitGatewayRouteTableId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Route.__pulumiType, name, resourceInputs, opts); } } exports.Route = Route; /** @internal */ Route.__pulumiType = 'aws:ec2transitgateway/route:Route'; //# sourceMappingURL=route.js.map