UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

390 lines (389 loc) 16.7 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * 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 * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: MicroserviceEngineState, opts?: pulumi.CustomResourceOptions): MicroserviceEngine; /** * 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: any): obj is MicroserviceEngine; /** * Specifies the account password. The corresponding account name is **root**. * Required if `authType` is **RBAC**. Changing this will create a new engine. * The password format must meet the following conditions: * + Must be `8` to `32` characters long. * + A password must contain at least one digit, one uppercase letter, one lowercase letter, and one special character * (-~!@#%^*_=+?$&()|<>{}[]). * + Cannot be the account name or account name spelled backwards. * + The password can only start with a letter. */ readonly adminPass: pulumi.Output<string | undefined>; /** * Specifies the authentication method for the dedicated microservice engine. * Changing this will create a new engine. * + **RBAC**: Enable security authentication. * Security authentication applies to the scenario where multiple users use the same engine. * After security authentication is enabled, all users who use the engine can log in using the account and password. * You can assign the account and role in the System Management. * + **NONE**: Disable security authentication. * After security authentication is disabled, all users who use the engine can use the engine without using the account * and password, and have the same operation permissions on all services. */ readonly authType: pulumi.Output<string>; /** * Specifies the list of availability zones. * Required if the `version` is **CSE2**. * Changing this will create a new engine. */ readonly availabilityZones: pulumi.Output<string[]>; /** * The address of config center. * The object structure is documented below. */ readonly configCenterAddresses: pulumi.Output<outputs.Cse.MicroserviceEngineConfigCenterAddress[]>; /** * Specifies the description of the dedicated microservice engine. * The description can contain a maximum of `255` characters. * Changing this will create a new engine. */ readonly description: pulumi.Output<string | undefined>; /** * Specifies the EIP ID to which the dedicated microservice engine assocated. * Changing this will create a new engine. */ readonly eipId: pulumi.Output<string | undefined>; /** * Specifies the enterprise project ID to which the dedicated * microservice engine belongs. * Changing this will create a new engine. */ readonly enterpriseProjectId: pulumi.Output<string>; /** * Specifies the additional parameters for the dedicated microservice engine. * Changing this will create a new engine. */ readonly extendParams: pulumi.Output<{ [key: string]: string; }>; /** * Specifies the flavor of the dedicated microservice engine. * Changing this will create a new engine. */ readonly flavor: pulumi.Output<string>; /** * The maximum number of the microservice instance resources. */ readonly instanceLimit: pulumi.Output<number>; /** * Specifies the name of the dedicated microservice engine. * The name can contain `3` to `24` characters, only letters, digits and hyphens (-) are allowed. * The name must start with a letter and cannot end with a hyphen (-). * Changing this will create a new engine. */ readonly name: pulumi.Output<string>; /** * Specifies the network ID of the subnet to which the dedicated microservice * engine belongs. Changing this will create a new engine. */ readonly networkId: pulumi.Output<string>; /** * Specifies the region in which to create the dedicated microservice engine. * If omitted, the provider-level region will be used. Changing this will create a new engine. */ readonly region: pulumi.Output<string>; /** * The maximum number of the microservice resources. */ readonly serviceLimit: pulumi.Output<number>; /** * The connection address of service center. * The object structure is documented below. */ readonly serviceRegistryAddresses: pulumi.Output<outputs.Cse.MicroserviceEngineServiceRegistryAddress[]>; /** * Specifies the version of the dedicated microservice engine. * The valid values are as follows: * + **CSE2** * + **Nacos2** */ readonly version: pulumi.Output<string | undefined>; /** * Create a MicroserviceEngine resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: MicroserviceEngineArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering MicroserviceEngine resources. */ export interface MicroserviceEngineState { /** * Specifies the account password. The corresponding account name is **root**. * Required if `authType` is **RBAC**. Changing this will create a new engine. * The password format must meet the following conditions: * + Must be `8` to `32` characters long. * + A password must contain at least one digit, one uppercase letter, one lowercase letter, and one special character * (-~!@#%^*_=+?$&()|<>{}[]). * + Cannot be the account name or account name spelled backwards. * + The password can only start with a letter. */ adminPass?: pulumi.Input<string>; /** * Specifies the authentication method for the dedicated microservice engine. * Changing this will create a new engine. * + **RBAC**: Enable security authentication. * Security authentication applies to the scenario where multiple users use the same engine. * After security authentication is enabled, all users who use the engine can log in using the account and password. * You can assign the account and role in the System Management. * + **NONE**: Disable security authentication. * After security authentication is disabled, all users who use the engine can use the engine without using the account * and password, and have the same operation permissions on all services. */ authType?: pulumi.Input<string>; /** * Specifies the list of availability zones. * Required if the `version` is **CSE2**. * Changing this will create a new engine. */ availabilityZones?: pulumi.Input<pulumi.Input<string>[]>; /** * The address of config center. * The object structure is documented below. */ configCenterAddresses?: pulumi.Input<pulumi.Input<inputs.Cse.MicroserviceEngineConfigCenterAddress>[]>; /** * Specifies the description of the dedicated microservice engine. * The description can contain a maximum of `255` characters. * Changing this will create a new engine. */ description?: pulumi.Input<string>; /** * Specifies the EIP ID to which the dedicated microservice engine assocated. * Changing this will create a new engine. */ eipId?: pulumi.Input<string>; /** * Specifies the enterprise project ID to which the dedicated * microservice engine belongs. * Changing this will create a new engine. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the additional parameters for the dedicated microservice engine. * Changing this will create a new engine. */ extendParams?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies the flavor of the dedicated microservice engine. * Changing this will create a new engine. */ flavor?: pulumi.Input<string>; /** * The maximum number of the microservice instance resources. */ instanceLimit?: pulumi.Input<number>; /** * Specifies the name of the dedicated microservice engine. * The name can contain `3` to `24` characters, only letters, digits and hyphens (-) are allowed. * The name must start with a letter and cannot end with a hyphen (-). * Changing this will create a new engine. */ name?: pulumi.Input<string>; /** * Specifies the network ID of the subnet to which the dedicated microservice * engine belongs. Changing this will create a new engine. */ networkId?: pulumi.Input<string>; /** * Specifies the region in which to create the dedicated microservice engine. * If omitted, the provider-level region will be used. Changing this will create a new engine. */ region?: pulumi.Input<string>; /** * The maximum number of the microservice resources. */ serviceLimit?: pulumi.Input<number>; /** * The connection address of service center. * The object structure is documented below. */ serviceRegistryAddresses?: pulumi.Input<pulumi.Input<inputs.Cse.MicroserviceEngineServiceRegistryAddress>[]>; /** * Specifies the version of the dedicated microservice engine. * The valid values are as follows: * + **CSE2** * + **Nacos2** */ version?: pulumi.Input<string>; } /** * The set of arguments for constructing a MicroserviceEngine resource. */ export interface MicroserviceEngineArgs { /** * Specifies the account password. The corresponding account name is **root**. * Required if `authType` is **RBAC**. Changing this will create a new engine. * The password format must meet the following conditions: * + Must be `8` to `32` characters long. * + A password must contain at least one digit, one uppercase letter, one lowercase letter, and one special character * (-~!@#%^*_=+?$&()|<>{}[]). * + Cannot be the account name or account name spelled backwards. * + The password can only start with a letter. */ adminPass?: pulumi.Input<string>; /** * Specifies the authentication method for the dedicated microservice engine. * Changing this will create a new engine. * + **RBAC**: Enable security authentication. * Security authentication applies to the scenario where multiple users use the same engine. * After security authentication is enabled, all users who use the engine can log in using the account and password. * You can assign the account and role in the System Management. * + **NONE**: Disable security authentication. * After security authentication is disabled, all users who use the engine can use the engine without using the account * and password, and have the same operation permissions on all services. */ authType: pulumi.Input<string>; /** * Specifies the list of availability zones. * Required if the `version` is **CSE2**. * Changing this will create a new engine. */ availabilityZones?: pulumi.Input<pulumi.Input<string>[]>; /** * Specifies the description of the dedicated microservice engine. * The description can contain a maximum of `255` characters. * Changing this will create a new engine. */ description?: pulumi.Input<string>; /** * Specifies the EIP ID to which the dedicated microservice engine assocated. * Changing this will create a new engine. */ eipId?: pulumi.Input<string>; /** * Specifies the enterprise project ID to which the dedicated * microservice engine belongs. * Changing this will create a new engine. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the additional parameters for the dedicated microservice engine. * Changing this will create a new engine. */ extendParams?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Specifies the flavor of the dedicated microservice engine. * Changing this will create a new engine. */ flavor: pulumi.Input<string>; /** * Specifies the name of the dedicated microservice engine. * The name can contain `3` to `24` characters, only letters, digits and hyphens (-) are allowed. * The name must start with a letter and cannot end with a hyphen (-). * Changing this will create a new engine. */ name?: pulumi.Input<string>; /** * Specifies the network ID of the subnet to which the dedicated microservice * engine belongs. Changing this will create a new engine. */ networkId: pulumi.Input<string>; /** * Specifies the region in which to create the dedicated microservice engine. * If omitted, the provider-level region will be used. Changing this will create a new engine. */ region?: pulumi.Input<string>; /** * Specifies the version of the dedicated microservice engine. * The valid values are as follows: * + **CSE2** * + **Nacos2** */ version?: pulumi.Input<string>; }