UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

161 lines 8.86 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.Instance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an APIG dedicated instance resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const instanceName = config.requireObject("instanceName"); * const vpcId = config.requireObject("vpcId"); * const subnetId = config.requireObject("subnetId"); * const securityGroupId = config.requireObject("securityGroupId"); * const enterpriseProjectId = config.requireObject("enterpriseProjectId"); * const testAvailabilityZones = huaweicloud.getAvailabilityZones({}); * const testInstance = new huaweicloud.dedicatedapig.Instance("testInstance", { * edition: "BASIC", * vpcId: vpcId, * subnetId: subnetId, * securityGroupId: securityGroupId, * enterpriseProjectId: enterpriseProjectId, * maintainBegin: "06:00:00", * description: "Created by script", * bandwidthSize: 3, * availableZones: [ * testAvailabilityZones.then(testAvailabilityZones => testAvailabilityZones.names?[0]), * testAvailabilityZones.then(testAvailabilityZones => testAvailabilityZones.names?[1]), * ], * tags: { * foo: "bar", * }, * }); * ``` * * ## Import * * Dedicated instances can be imported by their `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:DedicatedApig/instance:Instance test de379eed30aa4d31a84f426ea3c7ef4e * ``` */ class Instance extends pulumi.CustomResource { /** * Get an existing Instance 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 Instance(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Instance. 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'] === Instance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["availabilityZones"] = state ? state.availabilityZones : undefined; resourceInputs["availableZones"] = state ? state.availableZones : undefined; resourceInputs["bandwidthSize"] = state ? state.bandwidthSize : undefined; resourceInputs["createTime"] = state ? state.createTime : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["customIngressPorts"] = state ? state.customIngressPorts : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["edition"] = state ? state.edition : undefined; resourceInputs["egressAddress"] = state ? state.egressAddress : undefined; resourceInputs["eipId"] = state ? state.eipId : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["ingressAddress"] = state ? state.ingressAddress : undefined; resourceInputs["ingressBandwidthChargingMode"] = state ? state.ingressBandwidthChargingMode : undefined; resourceInputs["ingressBandwidthSize"] = state ? state.ingressBandwidthSize : undefined; resourceInputs["ipv6Enable"] = state ? state.ipv6Enable : undefined; resourceInputs["loadbalancerProvider"] = state ? state.loadbalancerProvider : undefined; resourceInputs["maintainBegin"] = state ? state.maintainBegin : undefined; resourceInputs["maintainEnd"] = state ? state.maintainEnd : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; resourceInputs["supportedFeatures"] = state ? state.supportedFeatures : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; resourceInputs["vpcIngressAddress"] = state ? state.vpcIngressAddress : undefined; resourceInputs["vpcepServiceAddress"] = state ? state.vpcepServiceAddress : undefined; resourceInputs["vpcepServiceName"] = state ? state.vpcepServiceName : undefined; } else { const args = argsOrState; if ((!args || args.edition === undefined) && !opts.urn) { throw new Error("Missing required property 'edition'"); } if ((!args || args.securityGroupId === undefined) && !opts.urn) { throw new Error("Missing required property 'securityGroupId'"); } if ((!args || args.subnetId === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } if ((!args || args.vpcId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["availabilityZones"] = args ? args.availabilityZones : undefined; resourceInputs["availableZones"] = args ? args.availableZones : undefined; resourceInputs["bandwidthSize"] = args ? args.bandwidthSize : undefined; resourceInputs["customIngressPorts"] = args ? args.customIngressPorts : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["edition"] = args ? args.edition : undefined; resourceInputs["eipId"] = args ? args.eipId : undefined; resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["ingressBandwidthChargingMode"] = args ? args.ingressBandwidthChargingMode : undefined; resourceInputs["ingressBandwidthSize"] = args ? args.ingressBandwidthSize : undefined; resourceInputs["ipv6Enable"] = args ? args.ipv6Enable : undefined; resourceInputs["loadbalancerProvider"] = args ? args.loadbalancerProvider : undefined; resourceInputs["maintainBegin"] = args ? args.maintainBegin : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["securityGroupId"] = args ? args.securityGroupId : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["vpcId"] = args ? args.vpcId : undefined; resourceInputs["vpcepServiceName"] = args ? args.vpcepServiceName : undefined; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["egressAddress"] = undefined /*out*/; resourceInputs["ingressAddress"] = undefined /*out*/; resourceInputs["maintainEnd"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["supportedFeatures"] = undefined /*out*/; resourceInputs["vpcIngressAddress"] = undefined /*out*/; resourceInputs["vpcepServiceAddress"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Instance.__pulumiType, name, resourceInputs, opts); } } exports.Instance = Instance; /** @internal */ Instance.__pulumiType = 'huaweicloud:DedicatedApig/instance:Instance'; //# sourceMappingURL=instance.js.map