@pulumi/openstack
Version: 
A Pulumi package for creating and managing OpenStack cloud resources.
92 lines • 3.83 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, { ...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?.advertiseExtraRoutes;
            resourceInputs["bgpvpnId"] = state?.bgpvpnId;
            resourceInputs["projectId"] = state?.projectId;
            resourceInputs["region"] = state?.region;
            resourceInputs["routerId"] = state?.routerId;
        }
        else {
            const args = argsOrState;
            if (args?.bgpvpnId === undefined && !opts.urn) {
                throw new Error("Missing required property 'bgpvpnId'");
            }
            if (args?.routerId === undefined && !opts.urn) {
                throw new Error("Missing required property 'routerId'");
            }
            resourceInputs["advertiseExtraRoutes"] = args?.advertiseExtraRoutes;
            resourceInputs["bgpvpnId"] = args?.bgpvpnId;
            resourceInputs["projectId"] = args?.projectId;
            resourceInputs["region"] = args?.region;
            resourceInputs["routerId"] = args?.routerId;
        }
        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