@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
158 lines • 7.72 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.MicroserviceEngine = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a dedicated microservice engine (2.0+) resource within HuaweiCloud.
*
* ## Example Usage
* ### Create an engine for the default type CSE
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const engineName = config.requireObject("engineName");
* const networkId = config.requireObject("networkId");
* const floatingIpId = config.requireObject("floatingIpId");
* const availabilityZones = config.requireObject("availabilityZones");
* const managerPassword = config.requireObject("managerPassword");
* const test = new huaweicloud.cse.MicroserviceEngine("test", {
* flavor: "cse.s1.small2",
* networkId: networkId,
* eipId: floatingIpId,
* availabilityZones: availabilityZones,
* authType: "RBAC",
* adminPass: managerPassword,
* });
* ```
* ### Create an engine for the type Nacos
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const engineName = config.requireObject("engineName");
* const networkId = config.requireObject("networkId");
* const test = new huaweicloud.cse.MicroserviceEngine("test", {
* flavor: "cse.nacos2.c1.large.10",
* networkId: networkId,
* authType: "NONE",
* version: "Nacos2",
* });
* ```
*
* ## Import
*
* Engines can be imported using their `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Cse/microserviceEngine:MicroserviceEngine test eddc5d42-f9d5-4f8e-984b-d6f3e088561c
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes are `admin_pass` and `extend_params`. It is generally recommended running `terraform plan` after importing an instance. You can then decide if changes should be applied to the instance, or the resource definition should be updated to align with the instance. Also you can ignore changes as below. hcl resource "huaweicloud_cse_microservice_engine" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* admin_pass,
*
* extend_params,
*
* ]
*
* } } For the engine created with the `enterprise_project_id`, its enterprise project ID needs to be specified additionally when importing, the format is `<id>/<enterprise_project_id>`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Cse/microserviceEngine:MicroserviceEngine test eddc5d42-f9d5-4f8e-984b-d6f3e088561c/ef101e1a-990c-42cd-bb99-a4474e41e461
* ```
*/
class MicroserviceEngine extends pulumi.CustomResource {
/**
* Get an existing MicroserviceEngine 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 MicroserviceEngine(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MicroserviceEngine. 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'] === MicroserviceEngine.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["adminPass"] = state ? state.adminPass : undefined;
resourceInputs["authType"] = state ? state.authType : undefined;
resourceInputs["availabilityZones"] = state ? state.availabilityZones : undefined;
resourceInputs["configCenterAddresses"] = state ? state.configCenterAddresses : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["eipId"] = state ? state.eipId : undefined;
resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined;
resourceInputs["extendParams"] = state ? state.extendParams : undefined;
resourceInputs["flavor"] = state ? state.flavor : undefined;
resourceInputs["instanceLimit"] = state ? state.instanceLimit : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["networkId"] = state ? state.networkId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["serviceLimit"] = state ? state.serviceLimit : undefined;
resourceInputs["serviceRegistryAddresses"] = state ? state.serviceRegistryAddresses : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.authType === undefined) && !opts.urn) {
throw new Error("Missing required property 'authType'");
}
if ((!args || args.flavor === undefined) && !opts.urn) {
throw new Error("Missing required property 'flavor'");
}
if ((!args || args.networkId === undefined) && !opts.urn) {
throw new Error("Missing required property 'networkId'");
}
resourceInputs["adminPass"] = args ? args.adminPass : undefined;
resourceInputs["authType"] = args ? args.authType : undefined;
resourceInputs["availabilityZones"] = args ? args.availabilityZones : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["eipId"] = args ? args.eipId : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["extendParams"] = args ? args.extendParams : undefined;
resourceInputs["flavor"] = args ? args.flavor : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["networkId"] = args ? args.networkId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["configCenterAddresses"] = undefined /*out*/;
resourceInputs["instanceLimit"] = undefined /*out*/;
resourceInputs["serviceLimit"] = undefined /*out*/;
resourceInputs["serviceRegistryAddresses"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MicroserviceEngine.__pulumiType, name, resourceInputs, opts);
}
}
exports.MicroserviceEngine = MicroserviceEngine;
/** @internal */
MicroserviceEngine.__pulumiType = 'huaweicloud:Cse/microserviceEngine:MicroserviceEngine';
//# sourceMappingURL=microserviceEngine.js.map