@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
129 lines • 6.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.Microservice = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a dedicated microservice resource within HuaweiCloud.
*
* > 1. Before creating a configuration, make sure the engine has enabled the rules shown in the appendix
* > table.
* > <br/> 2. When deleting a microservice, all instances under it will also be deleted together.
*
* ## Example Usage
* ## Appendix
*
* <a name="microserviceDefaultEngineAccessRules"></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
*
* Microservices can be imported using related `auth_address`, `connect_address` and their `id`, separated by the slashes (/), e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Cse/microservice:Microservice test <auth_address>/<connect_address>/<id>
* ```
*
* If you enabled the **RBAC** authorization, you also need 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/microservice:Microservice test <auth_address>/<connect_address>/<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/microservice:Microservice test https://124.70.26.32:30100/https://124.70.26.32:30100/f14960ba495e03f59f85aacaaafbdef3fbff3f0d/root/Test\!123
* ```
*
* bash
*
* ```sh
* $ pulumi import huaweicloud:Cse/microservice:Microservice test 'https://124.70.26.32:30100/https://124.70.26.32:30100/f14960ba495e03f59f85aacaaafbdef3fbff3f0d/root/Test!123'
* ```
*/
class Microservice extends pulumi.CustomResource {
/**
* Get an existing Microservice 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 Microservice(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Microservice. 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'] === Microservice.__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["appName"] = state ? state.appName : undefined;
resourceInputs["authAddress"] = state ? state.authAddress : undefined;
resourceInputs["connectAddress"] = state ? state.connectAddress : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["environment"] = state ? state.environment : undefined;
resourceInputs["level"] = state ? state.level : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.appName === undefined) && !opts.urn) {
throw new Error("Missing required property 'appName'");
}
if ((!args || args.connectAddress === undefined) && !opts.urn) {
throw new Error("Missing required property 'connectAddress'");
}
if ((!args || args.version === undefined) && !opts.urn) {
throw new Error("Missing required property 'version'");
}
resourceInputs["adminPass"] = args ? args.adminPass : undefined;
resourceInputs["adminUser"] = args ? args.adminUser : undefined;
resourceInputs["appName"] = args ? args.appName : undefined;
resourceInputs["authAddress"] = args ? args.authAddress : undefined;
resourceInputs["connectAddress"] = args ? args.connectAddress : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["environment"] = args ? args.environment : undefined;
resourceInputs["level"] = args ? args.level : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["version"] = args ? args.version : undefined;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Microservice.__pulumiType, name, resourceInputs, opts);
}
}
exports.Microservice = Microservice;
/** @internal */
Microservice.__pulumiType = 'huaweicloud:Cse/microservice:Microservice';
//# sourceMappingURL=microservice.js.map