@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
98 lines • 4.5 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.Eip = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a eip resource within HuaweiCloud IEC.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const iecSites = huaweicloud.Iec.getSites({});
* const eipTest = new huaweicloud.iec.Eip("eipTest", {siteId: iecSites.then(iecSites => iecSites.sites?[0]?.id)});
* ```
*
* ## Import
*
* IEC EIPs can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Iec/eip:Eip eip_test b5ad19d1-57d1-48fd-aab7-1378f9bee169
* ```
*/
class Eip extends pulumi.CustomResource {
/**
* Get an existing Eip 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 Eip(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Eip. 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'] === Eip.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bandwidthId"] = state ? state.bandwidthId : undefined;
resourceInputs["bandwidthName"] = state ? state.bandwidthName : undefined;
resourceInputs["bandwidthShareType"] = state ? state.bandwidthShareType : undefined;
resourceInputs["bandwidthSize"] = state ? state.bandwidthSize : undefined;
resourceInputs["ipVersion"] = state ? state.ipVersion : undefined;
resourceInputs["lineId"] = state ? state.lineId : undefined;
resourceInputs["portId"] = state ? state.portId : undefined;
resourceInputs["privateIp"] = state ? state.privateIp : undefined;
resourceInputs["publicIp"] = state ? state.publicIp : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["siteId"] = state ? state.siteId : undefined;
resourceInputs["siteInfo"] = state ? state.siteInfo : undefined;
resourceInputs["status"] = state ? state.status : undefined;
}
else {
const args = argsOrState;
if ((!args || args.siteId === undefined) && !opts.urn) {
throw new Error("Missing required property 'siteId'");
}
resourceInputs["ipVersion"] = args ? args.ipVersion : undefined;
resourceInputs["lineId"] = args ? args.lineId : undefined;
resourceInputs["portId"] = args ? args.portId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["siteId"] = args ? args.siteId : undefined;
resourceInputs["bandwidthId"] = undefined /*out*/;
resourceInputs["bandwidthName"] = undefined /*out*/;
resourceInputs["bandwidthShareType"] = undefined /*out*/;
resourceInputs["bandwidthSize"] = undefined /*out*/;
resourceInputs["privateIp"] = undefined /*out*/;
resourceInputs["publicIp"] = undefined /*out*/;
resourceInputs["siteInfo"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Eip.__pulumiType, name, resourceInputs, opts);
}
}
exports.Eip = Eip;
/** @internal */
Eip.__pulumiType = 'huaweicloud:Iec/eip:Eip';
//# sourceMappingURL=eip.js.map