@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
133 lines • 7.47 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.MicroserviceInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a dedicated microservice instance resource within HuaweiCloud.
*
* > Before creating a configuration, make sure the engine has enabled the rules shown in the appendix
* table.
*
* ## Example Usage
* ## Appendix
*
* <a name="microserviceInstanceDefaultEngineAccessRules"></a>
* Security group rules required to access the engine:
* (Remote is not the minimum range and can be adjusted according to business needs)
*
* | Direction | Priority | Action | Protocol | Ports | Ethertype | Remote |
* | --------- | -------- | ------ | -------- | ------------- | --------- | --------------------- |
* | Ingress | 1 | Allow | ICMP | All | Ipv6 | ::/0 |
* | Ingress | 1 | Allow | TCP | 30100-30130 | Ipv6 | ::/0 |
* | Ingress | 1 | Allow | All | All | Ipv6 | cse-engine-default-sg |
* | Ingress | 1 | Allow | ICMP | All | Ipv4 | 0.0.0.0/0 |
* | Ingress | 1 | Allow | TCP | 30100-30130 | Ipv4 | 0.0.0.0/0 |
* | Ingress | 1 | Allow | All | All | Ipv4 | cse-engine-default-sg |
* | Egress | 100 | Allow | All | All | Ipv6 | ::/0 |
* | Egress | 100 | Allow | All | All | Ipv4 | 0.0.0.0/0 |
*
* ## Import
*
* Microservice instances can be imported using related `auth_address`, `connect_address`, `microservice_id` and their `id`, separated by the slashes (/), e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Cse/microserviceInstance:MicroserviceInstance test <auth_address>/<connect_address>/<microservice_id>/<id>
* ```
*
* If you enabled the **RBAC** authorization in the microservice engine, it's necessary to provide the account name (`admin_user`) and password (`admin_pass`) of the microservice engine. All fields separated by the slashes (/), e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Cse/microserviceInstance:MicroserviceInstance test <auth_address>/<connect_address>/<microservice_id>/<id>/<admin_user>/<admin_pass>
* ```
*
* The single quotes (') or backslashes (\\) can help you solve the problem of special characters reporting errors on bash. bash
*
* ```sh
* $ pulumi import huaweicloud:Cse/microserviceInstance:MicroserviceInstance test https://124.70.26.32:30100/https://124.70.26.32:30100/f14960ba495e03f59f85aacaaafbdef3fbff3f0d/336e7428dd9411eca913fa163e7364b7/root/Test\!123
* ```
*
* bash
*
* ```sh
* $ pulumi import huaweicloud:Cse/microserviceInstance:MicroserviceInstance test 'https://124.70.26.32:30100/https://124.70.26.32:30100/f14960ba495e03f59f85aacaaafbdef3fbff3f0d/336e7428dd9411eca913fa163e7364b7/root/Test!123'
* ```
*/
class MicroserviceInstance extends pulumi.CustomResource {
/**
* Get an existing MicroserviceInstance 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 MicroserviceInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MicroserviceInstance. 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'] === MicroserviceInstance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["adminPass"] = state ? state.adminPass : undefined;
resourceInputs["adminUser"] = state ? state.adminUser : undefined;
resourceInputs["authAddress"] = state ? state.authAddress : undefined;
resourceInputs["connectAddress"] = state ? state.connectAddress : undefined;
resourceInputs["dataCenter"] = state ? state.dataCenter : undefined;
resourceInputs["endpoints"] = state ? state.endpoints : undefined;
resourceInputs["healthCheck"] = state ? state.healthCheck : undefined;
resourceInputs["hostName"] = state ? state.hostName : undefined;
resourceInputs["microserviceId"] = state ? state.microserviceId : undefined;
resourceInputs["properties"] = state ? state.properties : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.connectAddress === undefined) && !opts.urn) {
throw new Error("Missing required property 'connectAddress'");
}
if ((!args || args.endpoints === undefined) && !opts.urn) {
throw new Error("Missing required property 'endpoints'");
}
if ((!args || args.hostName === undefined) && !opts.urn) {
throw new Error("Missing required property 'hostName'");
}
if ((!args || args.microserviceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'microserviceId'");
}
resourceInputs["adminPass"] = args ? args.adminPass : undefined;
resourceInputs["adminUser"] = args ? args.adminUser : undefined;
resourceInputs["authAddress"] = args ? args.authAddress : undefined;
resourceInputs["connectAddress"] = args ? args.connectAddress : undefined;
resourceInputs["dataCenter"] = args ? args.dataCenter : undefined;
resourceInputs["endpoints"] = args ? args.endpoints : undefined;
resourceInputs["healthCheck"] = args ? args.healthCheck : undefined;
resourceInputs["hostName"] = args ? args.hostName : undefined;
resourceInputs["microserviceId"] = args ? args.microserviceId : undefined;
resourceInputs["properties"] = args ? args.properties : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MicroserviceInstance.__pulumiType, name, resourceInputs, opts);
}
}
exports.MicroserviceInstance = MicroserviceInstance;
/** @internal */
MicroserviceInstance.__pulumiType = 'huaweicloud:Cse/microserviceInstance:MicroserviceInstance';
//# sourceMappingURL=microserviceInstance.js.map