@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
97 lines • 4.61 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.GatewayRoute = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage direct connect gateway route
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.direct_connect.GatewayRoute("foo", {
* destinationCidrBlock: "192.168.40.0/24",
* directConnectGatewayId: "dcg-172frxs5utjb44d1w33op****",
* nextHopId: "dcv-1729lrbfx7fuo4d1w34pk****",
* });
* ```
*
* ## Import
*
* DirectConnectGatewayRoute can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:direct_connect/gatewayRoute:GatewayRoute default resource_id
* ```
*/
class GatewayRoute extends pulumi.CustomResource {
/**
* Get an existing GatewayRoute 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 GatewayRoute(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of GatewayRoute. 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'] === GatewayRoute.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state ? state.accountId : undefined;
resourceInputs["creationTime"] = state ? state.creationTime : undefined;
resourceInputs["destinationCidrBlock"] = state ? state.destinationCidrBlock : undefined;
resourceInputs["directConnectGatewayId"] = state ? state.directConnectGatewayId : undefined;
resourceInputs["directConnectGatewayRouteId"] = state ? state.directConnectGatewayRouteId : undefined;
resourceInputs["nextHopId"] = state ? state.nextHopId : undefined;
resourceInputs["nextHopType"] = state ? state.nextHopType : undefined;
resourceInputs["routeType"] = state ? state.routeType : undefined;
resourceInputs["status"] = state ? state.status : undefined;
}
else {
const args = argsOrState;
if ((!args || args.destinationCidrBlock === undefined) && !opts.urn) {
throw new Error("Missing required property 'destinationCidrBlock'");
}
if ((!args || args.directConnectGatewayId === undefined) && !opts.urn) {
throw new Error("Missing required property 'directConnectGatewayId'");
}
if ((!args || args.nextHopId === undefined) && !opts.urn) {
throw new Error("Missing required property 'nextHopId'");
}
resourceInputs["destinationCidrBlock"] = args ? args.destinationCidrBlock : undefined;
resourceInputs["directConnectGatewayId"] = args ? args.directConnectGatewayId : undefined;
resourceInputs["nextHopId"] = args ? args.nextHopId : undefined;
resourceInputs["accountId"] = undefined /*out*/;
resourceInputs["creationTime"] = undefined /*out*/;
resourceInputs["directConnectGatewayRouteId"] = undefined /*out*/;
resourceInputs["nextHopType"] = undefined /*out*/;
resourceInputs["routeType"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(GatewayRoute.__pulumiType, name, resourceInputs, opts);
}
}
exports.GatewayRoute = GatewayRoute;
/** @internal */
GatewayRoute.__pulumiType = 'volcengine:direct_connect/gatewayRoute:GatewayRoute';
//# sourceMappingURL=gatewayRoute.js.map