UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

86 lines 4.22 kB
"use strict"; // *** 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.PeeringConnection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage a VPC Peering Connection resource. * * > **NOTE:** For cross-tenant (requester's tenant differs from the accepter's tenant) VPC Peering Connections, * use the `huaweicloud.Vpc.PeeringConnection` resource to manage the requester's side of the connection and * use the `huaweicloud.Vpc.PeeringConnectionAccepter` resource to manage the accepter's side of the connection. * <br/>If you create a VPC peering connection with another VPC of your own, the connection is created without the need * for you to accept the connection. * * ## Example Usage * * ## Import * * VPC Peering resources can be imported using the `vpc peering id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Vpc/peeringConnection:PeeringConnection test_connection 22b76469-08e3-4937-8c1d-7aad34892be1 * ``` */ class PeeringConnection extends pulumi.CustomResource { /** * Get an existing PeeringConnection 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 PeeringConnection(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of PeeringConnection. 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'] === PeeringConnection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["peerTenantId"] = state ? state.peerTenantId : undefined; resourceInputs["peerVpcId"] = state ? state.peerVpcId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.peerVpcId === undefined) && !opts.urn) { throw new Error("Missing required property 'peerVpcId'"); } if ((!args || args.vpcId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["peerTenantId"] = args ? args.peerTenantId : undefined; resourceInputs["peerVpcId"] = args ? args.peerVpcId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["vpcId"] = args ? args.vpcId : undefined; resourceInputs["status"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(PeeringConnection.__pulumiType, name, resourceInputs, opts); } } exports.PeeringConnection = PeeringConnection; /** @internal */ PeeringConnection.__pulumiType = 'huaweicloud:Vpc/peeringConnection:PeeringConnection'; //# sourceMappingURL=peeringConnection.js.map