@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
92 lines • 4.07 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.RouterAssociateV2 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a V2 BGP VPN router association resource within OpenStack.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const association1 = new openstack.bgpvpn.RouterAssociateV2("association_1", {
* bgpvpnId: "d57d39e1-dc63-44fd-8cbd-a4e1488100c5",
* routerId: "423fa80f-e0d7-4d02-a9a5-8b8c05812bf6",
* });
* ```
*
* ## Import
*
* BGP VPN router associations can be imported using the BGP VPN ID and BGP VPN
*
* router association ID separated by a slash, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import openstack:bgpvpn/routerAssociateV2:RouterAssociateV2 association_1 e26d509e-fc2d-4fb5-8562-619911a9a6bc/3cc9df2d-80db-4536-8ba6-295d1d0f723f
* ```
*/
class RouterAssociateV2 extends pulumi.CustomResource {
/**
* Get an existing RouterAssociateV2 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 RouterAssociateV2(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RouterAssociateV2. 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'] === RouterAssociateV2.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["advertiseExtraRoutes"] = state ? state.advertiseExtraRoutes : undefined;
resourceInputs["bgpvpnId"] = state ? state.bgpvpnId : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["routerId"] = state ? state.routerId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.bgpvpnId === undefined) && !opts.urn) {
throw new Error("Missing required property 'bgpvpnId'");
}
if ((!args || args.routerId === undefined) && !opts.urn) {
throw new Error("Missing required property 'routerId'");
}
resourceInputs["advertiseExtraRoutes"] = args ? args.advertiseExtraRoutes : undefined;
resourceInputs["bgpvpnId"] = args ? args.bgpvpnId : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["routerId"] = args ? args.routerId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "openstack:index/bgpvpnRouterAssociateV2:BgpvpnRouterAssociateV2" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(RouterAssociateV2.__pulumiType, name, resourceInputs, opts);
}
}
exports.RouterAssociateV2 = RouterAssociateV2;
/** @internal */
RouterAssociateV2.__pulumiType = 'openstack:bgpvpn/routerAssociateV2:RouterAssociateV2';
//# sourceMappingURL=routerAssociateV2.js.map