@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
88 lines • 4.14 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.LocalGatewayRoute = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an EC2 Local Gateway Route. More information can be found in the [Outposts User Guide](https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#routing).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ec2.LocalGatewayRoute("example", {
* destinationCidrBlock: "172.16.0.0/16",
* localGatewayRouteTableId: exampleAwsEc2LocalGatewayRouteTable.id,
* localGatewayVirtualInterfaceGroupId: exampleAwsEc2LocalGatewayVirtualInterfaceGroup.id,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_ec2_local_gateway_route` using the EC2 Local Gateway Route Table identifier and destination CIDR block separated by underscores (`_`). For example:
*
* ```sh
* $ pulumi import aws:ec2/localGatewayRoute:LocalGatewayRoute example lgw-rtb-12345678_172.16.0.0/16
* ```
*/
class LocalGatewayRoute extends pulumi.CustomResource {
/**
* Get an existing LocalGatewayRoute 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 LocalGatewayRoute(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of LocalGatewayRoute. 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'] === LocalGatewayRoute.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["destinationCidrBlock"] = state?.destinationCidrBlock;
resourceInputs["localGatewayRouteTableId"] = state?.localGatewayRouteTableId;
resourceInputs["localGatewayVirtualInterfaceGroupId"] = state?.localGatewayVirtualInterfaceGroupId;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.destinationCidrBlock === undefined && !opts.urn) {
throw new Error("Missing required property 'destinationCidrBlock'");
}
if (args?.localGatewayRouteTableId === undefined && !opts.urn) {
throw new Error("Missing required property 'localGatewayRouteTableId'");
}
if (args?.localGatewayVirtualInterfaceGroupId === undefined && !opts.urn) {
throw new Error("Missing required property 'localGatewayVirtualInterfaceGroupId'");
}
resourceInputs["destinationCidrBlock"] = args?.destinationCidrBlock;
resourceInputs["localGatewayRouteTableId"] = args?.localGatewayRouteTableId;
resourceInputs["localGatewayVirtualInterfaceGroupId"] = args?.localGatewayVirtualInterfaceGroupId;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LocalGatewayRoute.__pulumiType, name, resourceInputs, opts);
}
}
exports.LocalGatewayRoute = LocalGatewayRoute;
/** @internal */
LocalGatewayRoute.__pulumiType = 'aws:ec2/localGatewayRoute:LocalGatewayRoute';
//# sourceMappingURL=localGatewayRoute.js.map