@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
105 lines • 4.08 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.Approval = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage the VPC endpoint connections.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const serviceVpcId = config.requireObject("serviceVpcId");
* const vmPort = config.requireObject("vmPort");
* const vpcId = config.requireObject("vpcId");
* const networkId = config.requireObject("networkId");
* const demoService = new huaweicloud.vpcep.Service("demoService", {
* serverType: "VM",
* vpcId: serviceVpcId,
* portId: vmPort,
* approval: true,
* portMappings: [{
* servicePort: 8080,
* terminalPort: 80,
* }],
* });
* const demoEndpoint = new huaweicloud.vpcep.Endpoint("demoEndpoint", {
* serviceId: demoService.id,
* vpcId: vpcId,
* networkId: networkId,
* enableDns: true,
* });
* const approval = new huaweicloud.vpcep.Approval("approval", {
* serviceId: demoService.id,
* endpoints: [demoEndpoint.id],
* });
* ```
*
* ## Import
*
* VPC endpoint approval can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Vpcep/approval:Approval test <id>
* ```
*/
class Approval extends pulumi.CustomResource {
/**
* Get an existing Approval 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 Approval(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Approval. 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'] === Approval.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["connections"] = state ? state.connections : undefined;
resourceInputs["endpoints"] = state ? state.endpoints : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["serviceId"] = state ? state.serviceId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.endpoints === undefined) && !opts.urn) {
throw new Error("Missing required property 'endpoints'");
}
if ((!args || args.serviceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'serviceId'");
}
resourceInputs["endpoints"] = args ? args.endpoints : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["serviceId"] = args ? args.serviceId : undefined;
resourceInputs["connections"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Approval.__pulumiType, name, resourceInputs, opts);
}
}
exports.Approval = Approval;
/** @internal */
Approval.__pulumiType = 'huaweicloud:Vpcep/approval:Approval';
//# sourceMappingURL=approval.js.map