@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
202 lines • 9.85 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.Server = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a IEC server resource within HuaweiCloud.
*
* ## Example Usage
* ### Basic Server Instance
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const iecServerName = config.requireObject("iecServerName");
* const iecIamgeId = config.requireObject("iecIamgeId");
* const iecFlavorId = config.requireObject("iecFlavorId");
* const iecSiteId = config.requireObject("iecSiteId");
* const iecSiteOperator = config.requireObject("iecSiteOperator");
* const iecVpcId = config.requireObject("iecVpcId");
* const iecSubnetId = config.requireObject("iecSubnetId");
* const iecSecgroupId = config.requireObject("iecSecgroupId");
* const iecServerPassword = config.requireObject("iecServerPassword");
* const serverTest = new huaweicloud.iec.Server("serverTest", {
* imageId: iecIamgeId,
* flavorId: iecFlavorId,
* vpcId: iecVpcId,
* subnetIds: [iecSubnetId],
* securityGroups: [iecSecgroupId],
* adminPass: iecServerPassword,
* bindEip: true,
* systemDiskType: "SAS",
* systemDiskSize: 40,
* coverageSites: [{
* siteId: iecSiteId,
* operator: iecSiteOperator,
* }],
* });
* ```
* ### Server Instance With Multiple Data Disks
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const iecServerName = config.requireObject("iecServerName");
* const iecIamgeId = config.requireObject("iecIamgeId");
* const iecFlavorId = config.requireObject("iecFlavorId");
* const iecSiteId = config.requireObject("iecSiteId");
* const iecSiteOperator = config.requireObject("iecSiteOperator");
* const iecVpcId = config.requireObject("iecVpcId");
* const iecSubnetId = config.requireObject("iecSubnetId");
* const iecSecgroupId = config.requireObject("iecSecgroupId");
* const iecServerPassword = config.requireObject("iecServerPassword");
* const serverTest = new huaweicloud.iec.Server("serverTest", {
* imageId: iecIamgeId,
* flavorId: iecFlavorId,
* vpcId: iecVpcId,
* subnetIds: [iecSubnetId],
* securityGroups: [iecSecgroupId],
* adminPass: iecServerPassword,
* bindEip: true,
* systemDiskType: "SAS",
* systemDiskSize: 40,
* dataDisks: [
* {
* type: "SAS",
* size: 20,
* },
* {
* type: "SAS",
* size: 40,
* },
* ],
* coverageSites: [{
* siteId: iecSiteId,
* operator: iecSiteOperator,
* }],
* });
* ```
*/
class Server extends pulumi.CustomResource {
/**
* Get an existing Server 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 Server(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Server. 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'] === Server.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["adminPass"] = state ? state.adminPass : undefined;
resourceInputs["bindEip"] = state ? state.bindEip : undefined;
resourceInputs["coverageLevel"] = state ? state.coverageLevel : undefined;
resourceInputs["coveragePolicy"] = state ? state.coveragePolicy : undefined;
resourceInputs["coverageSites"] = state ? state.coverageSites : undefined;
resourceInputs["dataDisks"] = state ? state.dataDisks : undefined;
resourceInputs["edgecloudId"] = state ? state.edgecloudId : undefined;
resourceInputs["edgecloudName"] = state ? state.edgecloudName : undefined;
resourceInputs["flavorId"] = state ? state.flavorId : undefined;
resourceInputs["flavorName"] = state ? state.flavorName : undefined;
resourceInputs["imageId"] = state ? state.imageId : undefined;
resourceInputs["imageName"] = state ? state.imageName : undefined;
resourceInputs["keyPair"] = state ? state.keyPair : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["nics"] = state ? state.nics : undefined;
resourceInputs["originServerId"] = state ? state.originServerId : undefined;
resourceInputs["publicIp"] = state ? state.publicIp : undefined;
resourceInputs["securityGroups"] = state ? state.securityGroups : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["subnetIds"] = state ? state.subnetIds : undefined;
resourceInputs["systemDiskId"] = state ? state.systemDiskId : undefined;
resourceInputs["systemDiskSize"] = state ? state.systemDiskSize : undefined;
resourceInputs["systemDiskType"] = state ? state.systemDiskType : undefined;
resourceInputs["userData"] = state ? state.userData : undefined;
resourceInputs["volumeAttacheds"] = state ? state.volumeAttacheds : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.coverageSites === undefined) && !opts.urn) {
throw new Error("Missing required property 'coverageSites'");
}
if ((!args || args.flavorId === undefined) && !opts.urn) {
throw new Error("Missing required property 'flavorId'");
}
if ((!args || args.imageId === undefined) && !opts.urn) {
throw new Error("Missing required property 'imageId'");
}
if ((!args || args.securityGroups === undefined) && !opts.urn) {
throw new Error("Missing required property 'securityGroups'");
}
if ((!args || args.subnetIds === undefined) && !opts.urn) {
throw new Error("Missing required property 'subnetIds'");
}
if ((!args || args.systemDiskSize === undefined) && !opts.urn) {
throw new Error("Missing required property 'systemDiskSize'");
}
if ((!args || args.systemDiskType === undefined) && !opts.urn) {
throw new Error("Missing required property 'systemDiskType'");
}
if ((!args || args.vpcId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["adminPass"] = args ? args.adminPass : undefined;
resourceInputs["bindEip"] = args ? args.bindEip : undefined;
resourceInputs["coverageLevel"] = args ? args.coverageLevel : undefined;
resourceInputs["coveragePolicy"] = args ? args.coveragePolicy : undefined;
resourceInputs["coverageSites"] = args ? args.coverageSites : undefined;
resourceInputs["dataDisks"] = args ? args.dataDisks : undefined;
resourceInputs["flavorId"] = args ? args.flavorId : undefined;
resourceInputs["imageId"] = args ? args.imageId : undefined;
resourceInputs["keyPair"] = args ? args.keyPair : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["securityGroups"] = args ? args.securityGroups : undefined;
resourceInputs["subnetIds"] = args ? args.subnetIds : undefined;
resourceInputs["systemDiskSize"] = args ? args.systemDiskSize : undefined;
resourceInputs["systemDiskType"] = args ? args.systemDiskType : undefined;
resourceInputs["userData"] = args ? args.userData : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
resourceInputs["edgecloudId"] = undefined /*out*/;
resourceInputs["edgecloudName"] = undefined /*out*/;
resourceInputs["flavorName"] = undefined /*out*/;
resourceInputs["imageName"] = undefined /*out*/;
resourceInputs["nics"] = undefined /*out*/;
resourceInputs["originServerId"] = undefined /*out*/;
resourceInputs["publicIp"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["systemDiskId"] = undefined /*out*/;
resourceInputs["volumeAttacheds"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Server.__pulumiType, name, resourceInputs, opts);
}
}
exports.Server = Server;
/** @internal */
Server.__pulumiType = 'huaweicloud:Iec/server:Server';
//# sourceMappingURL=server.js.map