@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
133 lines • 6.58 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.Service = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a VPC endpoint service resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const vpcId = config.requireObject("vpcId");
* const vmPort = config.requireObject("vmPort");
* const demo = new huaweicloud.vpcep.Service("demo", {
* serverType: "VM",
* vpcId: vpcId,
* portId: vmPort,
* description: "test description",
* portMappings: [{
* servicePort: 8080,
* terminalPort: 80,
* }],
* });
* ```
*
* ## Import
*
* VPC endpoint services can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Vpcep/service:Service test_service <id>
* ```
*/
class Service extends pulumi.CustomResource {
/**
* Get an existing Service 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 Service(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Service. 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'] === Service.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["approval"] = state ? state.approval : undefined;
resourceInputs["connections"] = state ? state.connections : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["enablePolicy"] = state ? state.enablePolicy : undefined;
resourceInputs["ipAddress"] = state ? state.ipAddress : undefined;
resourceInputs["ipVersion"] = state ? state.ipVersion : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["organizationPermissions"] = state ? state.organizationPermissions : undefined;
resourceInputs["permissions"] = state ? state.permissions : undefined;
resourceInputs["poolId"] = state ? state.poolId : undefined;
resourceInputs["portId"] = state ? state.portId : undefined;
resourceInputs["portMappings"] = state ? state.portMappings : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["serverType"] = state ? state.serverType : undefined;
resourceInputs["serviceName"] = state ? state.serviceName : undefined;
resourceInputs["serviceType"] = state ? state.serviceType : undefined;
resourceInputs["snatNetworkId"] = state ? state.snatNetworkId : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tcpProxy"] = state ? state.tcpProxy : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.portId === undefined) && !opts.urn) {
throw new Error("Missing required property 'portId'");
}
if ((!args || args.portMappings === undefined) && !opts.urn) {
throw new Error("Missing required property 'portMappings'");
}
if ((!args || args.serverType === undefined) && !opts.urn) {
throw new Error("Missing required property 'serverType'");
}
if ((!args || args.vpcId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["approval"] = args ? args.approval : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enablePolicy"] = args ? args.enablePolicy : undefined;
resourceInputs["ipAddress"] = args ? args.ipAddress : undefined;
resourceInputs["ipVersion"] = args ? args.ipVersion : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["organizationPermissions"] = args ? args.organizationPermissions : undefined;
resourceInputs["permissions"] = args ? args.permissions : undefined;
resourceInputs["poolId"] = args ? args.poolId : undefined;
resourceInputs["portId"] = args ? args.portId : undefined;
resourceInputs["portMappings"] = args ? args.portMappings : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["serverType"] = args ? args.serverType : undefined;
resourceInputs["serviceType"] = args ? args.serviceType : undefined;
resourceInputs["snatNetworkId"] = args ? args.snatNetworkId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["tcpProxy"] = args ? args.tcpProxy : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
resourceInputs["connections"] = undefined /*out*/;
resourceInputs["serviceName"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Service.__pulumiType, name, resourceInputs, opts);
}
}
exports.Service = Service;
/** @internal */
Service.__pulumiType = 'huaweicloud:Vpcep/service:Service';
//# sourceMappingURL=service.js.map