@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
57 lines • 2.06 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.getPeeringConnectionOutput = exports.getPeeringConnection = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* The VPC Peering Connection data source provides details about a specific VPC peering connection.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const vpc = huaweicloud.Vpc.getVpc({
* name: "vpc",
* });
* const peerVpc = huaweicloud.Vpc.getVpc({
* name: "peer_vpc",
* });
* const peering = Promise.all([vpc, peerVpc]).then(([vpc, peerVpc]) => huaweicloud.Vpc.getPeeringConnection({
* vpcId: vpc.id,
* peerVpcId: peerVpc.id,
* }));
* const vpcRoute = new huaweicloud.vpc.Route("vpcRoute", {
* type: "peering",
* nexthop: peering.then(peering => peering.id),
* destination: "192.168.0.0/16",
* vpcId: vpc.then(vpc => vpc.id),
* });
* ```
*/
function getPeeringConnection(args, opts) {
args = args || {};
if (!opts) {
opts = {};
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
return pulumi.runtime.invoke("huaweicloud:Vpc/getPeeringConnection:getPeeringConnection", {
"id": args.id,
"name": args.name,
"peerTenantId": args.peerTenantId,
"peerVpcId": args.peerVpcId,
"region": args.region,
"status": args.status,
"vpcId": args.vpcId,
}, opts);
}
exports.getPeeringConnection = getPeeringConnection;
function getPeeringConnectionOutput(args, opts) {
return pulumi.output(args).apply(a => getPeeringConnection(a, opts));
}
exports.getPeeringConnectionOutput = getPeeringConnectionOutput;
//# sourceMappingURL=getPeeringConnection.js.map