UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

657 lines (656 loc) 24.6 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages a GaussDB(DWS) cluster resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const availabilityZone = config.requireObject("availabilityZone"); * const dwsClusterName = config.requireObject("dwsClusterName"); * const dwsClusterVersion = config.requireObject("dwsClusterVersion"); * const userName = config.requireObject("userName"); * const userPwd = config.requireObject("userPwd"); * const vpcId = config.requireObject("vpcId"); * const networkId = config.requireObject("networkId"); * const secgroup = new huaweicloud.vpc.Secgroup("secgroup", {description: "terraform security group"}); * const cluster = new huaweicloud.dws.Cluster("cluster", { * version: dwsClusterVersion, * nodeType: "dws.m3.xlarge", * numberOfNode: 3, * numberOfCn: 3, * availabilityZone: availabilityZone, * userName: userName, * userPwd: userPwd, * vpcId: vpcId, * networkId: networkId, * securityGroupId: secgroup.id, * volume: { * type: "SSD", * capacity: "300", * }, * }); * ``` * * ## Import * * The resource can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Dws/cluster:Cluster test <id> * ``` * * 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 include`user_pwd`, `number_of_cn`, `kms_key_id`, `volume`, `dss_pool_id`, `logical_cluster_enable`, `lts_enable`, `force_backup`. It is generally recommended running `terraform plan` after importing a cluster. You can then decide if changes should be applied to the cluster, or the resource definition should be updated to align with the cluster. Also you can ignore changes as below. hcl resource "huaweicloud_dws_cluster" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * user_pwd, number_of_cn, kms_key_id, volume, dss_pool_id, logical_cluster_enable, lts_enable, `force_backup`, * * ] * * } } */ export declare class Cluster extends pulumi.CustomResource { /** * Get an existing Cluster 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?: ClusterState, opts?: pulumi.CustomResourceOptions): Cluster; /** * Returns true if the given object is an instance of Cluster. 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 Cluster; /** * The availability zone in which to create the cluster instance. * If there are multiple available zones, separate by commas, e.g. **cn-north-4a,cn-north-4b,cn-north-4g**. * Currently, multi-AZ clusters only support selecting `3` AZs. Changing this parameter will create a new resource. */ readonly availabilityZone: pulumi.Output<string>; /** * The creation time of the cluster. * Format: ISO8601: **YYYY-MM-DDThh:mm:ssZ**. */ readonly created: pulumi.Output<string>; /** * Specifies the description of the cluster. */ readonly description: pulumi.Output<string | undefined>; /** * Dedicated storage pool ID. * Changing this parameter will create a new resource. */ readonly dssPoolId: pulumi.Output<string>; /** * Specifies the ID of the ELB load balancer. */ readonly elbId: pulumi.Output<string | undefined>; /** * The ELB information bound to the cluster. * The elb structure is documented below. */ readonly elbs: pulumi.Output<outputs.Dws.ClusterElb[]>; /** * Private network connection information about the cluster. * The Endpoint structure is documented below. */ readonly endpoints: pulumi.Output<outputs.Dws.ClusterEndpoint[]>; /** * The enterprise project ID. */ readonly enterpriseProjectId: pulumi.Output<string>; /** * Specified whether to automatically execute snapshot when shrinking the number of nodes. * The default value is **true**. * This parameter is required and available only when scaling-in the `numberOfNode` parameter value. */ readonly forceBackup: pulumi.Output<boolean | undefined>; /** * The number of latest manual snapshots that need to be * retained when deleting the cluster. */ readonly keepLastManualSnapshot: pulumi.Output<number | undefined>; /** * The KMS key ID. * Changing this parameter will create a new resource. */ readonly kmsKeyId: pulumi.Output<string>; /** * Specifies whether to enable logical cluster. The switch needs to be turned * on before creating a logical cluster. */ readonly logicalClusterEnable: pulumi.Output<boolean | undefined>; /** * Specifies whether to enable LTS. The default value is **false**. */ readonly ltsEnable: pulumi.Output<boolean | undefined>; /** * Cluster maintenance window. * The MaintainWindow structure is documented below. */ readonly maintainWindows: pulumi.Output<outputs.Dws.ClusterMaintainWindow[]>; /** * Cluster name, which must be unique and contains 4 to 64 characters, which * consist of letters, digits, hyphens(-), or underscores(_) only and must start with a letter. * Changing this creates a new cluster resource. */ readonly name: pulumi.Output<string>; /** * The subnet ID. * Changing this parameter will create a new resource. */ readonly networkId: pulumi.Output<string>; /** * The flavor of the cluster. * [For details](https://support.huaweicloud.com/intl/en-us/productdesc-dws/dws_01_00018.html). * Changing this parameter will create a new resource. */ readonly nodeType: pulumi.Output<string>; /** * The number of CN. * The value ranges from 2 to **number_of_node**, the maximum value is 20. * This parameter must be used together with `version`. * Changing this parameter will create a new resource. */ readonly numberOfCn: pulumi.Output<number | undefined>; /** * Number of nodes in a cluster. * The value ranges from 3 to 256 in cluster mode. The value of stream warehouse(stand-alone mode) is 1. */ readonly numberOfNode: pulumi.Output<number>; /** * Service port of a cluster (8000 to 10000). The default value is 8000. * Changing this parameter will create a new resource. */ readonly port: pulumi.Output<number | undefined>; /** * The private IP address of the ELB load balancer. */ readonly privateIps: pulumi.Output<string[]>; /** * Public network connection information about the cluster. * The PublicEndpoint structure is documented below. */ readonly publicEndpoints: pulumi.Output<outputs.Dws.ClusterPublicEndpoint[]>; /** * The information about public IP. */ readonly publicIp: pulumi.Output<outputs.Dws.ClusterPublicIp>; /** * The recent event number. */ readonly recentEvent: pulumi.Output<number>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ readonly region: pulumi.Output<string>; /** * Specifies the security group ID of the cluster. * Changing this parameter will create a new resource. */ readonly securityGroupId: pulumi.Output<string>; /** * The cluster status. * The valid values are **CREATING**, **AVAILABLE**, **ACTIVE**, **FAILED**, **CREATE_FAILED**, * **DELETING**, **DELETE_FAILED**, **DELETED**, and **FROZEN**. */ readonly status: pulumi.Output<string>; /** * Sub-status of clusters in the AVAILABLE state. * The value can be one of the following: * + READONLY * + REDISTRIBUTING * + REDISTRIBUTION-FAILURE * + UNBALANCED * + UNBALANCED | READONLY * + DEGRADED * + DEGRADED | READONLY * + DEGRADED | UNBALANCED * + UNBALANCED | REDISTRIBUTING * + UNBALANCED | REDISTRIBUTION-FAILURE * + READONLY | REDISTRIBUTION-FAILURE * + UNBALANCED | READONLY | REDISTRIBUTION-FAILURE * + DEGRADED | REDISTRIBUTION-FAILURE * + DEGRADED | UNBALANCED | REDISTRIBUTION-FAILURE * + DEGRADED | UNBALANCED | READONLY | REDISTRIBUTION-FAILURE * + DEGRADED | UNBALANCED | READONLY */ readonly subStatus: pulumi.Output<string>; /** * The key/value pairs to associate with the cluster. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Cluster management task. * The value can be one of the following: * + UNFREEZING * + FREEZING * + RESTORING * + SNAPSHOTTING * + GROWING * + REBOOTING * + SETTING_CONFIGURATION * + CONFIGURING_EXT_DATASOURCE * + DELETING_EXT_DATASOURCE * + REBOOT_FAILURE * + RESIZE_FAILURE */ readonly taskStatus: pulumi.Output<string>; /** * The updated time of the cluster. * Format: ISO8601: **YYYY-MM-DDThh:mm:ssZ**. */ readonly updated: pulumi.Output<string>; /** * Administrator username for logging in to a data warehouse cluster. * The administrator username must: Consist of lowercase letters, digits, or underscores. * Start with a lowercase letter or an underscore. * Changing this parameter will create a new resource. */ readonly userName: pulumi.Output<string>; /** * Administrator password for logging in to a data warehouse cluster. * A password contains 8 to 32 characters, which consist of letters, digits, * and special characters(~!@#%^&*()-_=+|[{}];:,<.>/?). * It cannot be the same as the username or the username written in reverse order. */ readonly userPwd: pulumi.Output<string>; /** * The cluster version. * [For details](https://support.huaweicloud.com/intl/en-us/bulletin-dws/dws_12_0000.html). * Changing this parameter will create a new resource. */ readonly version: pulumi.Output<string>; /** * The information about the volume. * Changing this parameter will create a new resource. * For local disks, this parameter can not be specified. */ readonly volume: pulumi.Output<outputs.Dws.ClusterVolume>; /** * The VPC ID. * Changing this parameter will create a new resource. */ readonly vpcId: pulumi.Output<string>; /** * Create a Cluster 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: ClusterArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Cluster resources. */ export interface ClusterState { /** * The availability zone in which to create the cluster instance. * If there are multiple available zones, separate by commas, e.g. **cn-north-4a,cn-north-4b,cn-north-4g**. * Currently, multi-AZ clusters only support selecting `3` AZs. Changing this parameter will create a new resource. */ availabilityZone?: pulumi.Input<string>; /** * The creation time of the cluster. * Format: ISO8601: **YYYY-MM-DDThh:mm:ssZ**. */ created?: pulumi.Input<string>; /** * Specifies the description of the cluster. */ description?: pulumi.Input<string>; /** * Dedicated storage pool ID. * Changing this parameter will create a new resource. */ dssPoolId?: pulumi.Input<string>; /** * Specifies the ID of the ELB load balancer. */ elbId?: pulumi.Input<string>; /** * The ELB information bound to the cluster. * The elb structure is documented below. */ elbs?: pulumi.Input<pulumi.Input<inputs.Dws.ClusterElb>[]>; /** * Private network connection information about the cluster. * The Endpoint structure is documented below. */ endpoints?: pulumi.Input<pulumi.Input<inputs.Dws.ClusterEndpoint>[]>; /** * The enterprise project ID. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specified whether to automatically execute snapshot when shrinking the number of nodes. * The default value is **true**. * This parameter is required and available only when scaling-in the `numberOfNode` parameter value. */ forceBackup?: pulumi.Input<boolean>; /** * The number of latest manual snapshots that need to be * retained when deleting the cluster. */ keepLastManualSnapshot?: pulumi.Input<number>; /** * The KMS key ID. * Changing this parameter will create a new resource. */ kmsKeyId?: pulumi.Input<string>; /** * Specifies whether to enable logical cluster. The switch needs to be turned * on before creating a logical cluster. */ logicalClusterEnable?: pulumi.Input<boolean>; /** * Specifies whether to enable LTS. The default value is **false**. */ ltsEnable?: pulumi.Input<boolean>; /** * Cluster maintenance window. * The MaintainWindow structure is documented below. */ maintainWindows?: pulumi.Input<pulumi.Input<inputs.Dws.ClusterMaintainWindow>[]>; /** * Cluster name, which must be unique and contains 4 to 64 characters, which * consist of letters, digits, hyphens(-), or underscores(_) only and must start with a letter. * Changing this creates a new cluster resource. */ name?: pulumi.Input<string>; /** * The subnet ID. * Changing this parameter will create a new resource. */ networkId?: pulumi.Input<string>; /** * The flavor of the cluster. * [For details](https://support.huaweicloud.com/intl/en-us/productdesc-dws/dws_01_00018.html). * Changing this parameter will create a new resource. */ nodeType?: pulumi.Input<string>; /** * The number of CN. * The value ranges from 2 to **number_of_node**, the maximum value is 20. * This parameter must be used together with `version`. * Changing this parameter will create a new resource. */ numberOfCn?: pulumi.Input<number>; /** * Number of nodes in a cluster. * The value ranges from 3 to 256 in cluster mode. The value of stream warehouse(stand-alone mode) is 1. */ numberOfNode?: pulumi.Input<number>; /** * Service port of a cluster (8000 to 10000). The default value is 8000. * Changing this parameter will create a new resource. */ port?: pulumi.Input<number>; /** * The private IP address of the ELB load balancer. */ privateIps?: pulumi.Input<pulumi.Input<string>[]>; /** * Public network connection information about the cluster. * The PublicEndpoint structure is documented below. */ publicEndpoints?: pulumi.Input<pulumi.Input<inputs.Dws.ClusterPublicEndpoint>[]>; /** * The information about public IP. */ publicIp?: pulumi.Input<inputs.Dws.ClusterPublicIp>; /** * The recent event number. */ recentEvent?: pulumi.Input<number>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Specifies the security group ID of the cluster. * Changing this parameter will create a new resource. */ securityGroupId?: pulumi.Input<string>; /** * The cluster status. * The valid values are **CREATING**, **AVAILABLE**, **ACTIVE**, **FAILED**, **CREATE_FAILED**, * **DELETING**, **DELETE_FAILED**, **DELETED**, and **FROZEN**. */ status?: pulumi.Input<string>; /** * Sub-status of clusters in the AVAILABLE state. * The value can be one of the following: * + READONLY * + REDISTRIBUTING * + REDISTRIBUTION-FAILURE * + UNBALANCED * + UNBALANCED | READONLY * + DEGRADED * + DEGRADED | READONLY * + DEGRADED | UNBALANCED * + UNBALANCED | REDISTRIBUTING * + UNBALANCED | REDISTRIBUTION-FAILURE * + READONLY | REDISTRIBUTION-FAILURE * + UNBALANCED | READONLY | REDISTRIBUTION-FAILURE * + DEGRADED | REDISTRIBUTION-FAILURE * + DEGRADED | UNBALANCED | REDISTRIBUTION-FAILURE * + DEGRADED | UNBALANCED | READONLY | REDISTRIBUTION-FAILURE * + DEGRADED | UNBALANCED | READONLY */ subStatus?: pulumi.Input<string>; /** * The key/value pairs to associate with the cluster. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Cluster management task. * The value can be one of the following: * + UNFREEZING * + FREEZING * + RESTORING * + SNAPSHOTTING * + GROWING * + REBOOTING * + SETTING_CONFIGURATION * + CONFIGURING_EXT_DATASOURCE * + DELETING_EXT_DATASOURCE * + REBOOT_FAILURE * + RESIZE_FAILURE */ taskStatus?: pulumi.Input<string>; /** * The updated time of the cluster. * Format: ISO8601: **YYYY-MM-DDThh:mm:ssZ**. */ updated?: pulumi.Input<string>; /** * Administrator username for logging in to a data warehouse cluster. * The administrator username must: Consist of lowercase letters, digits, or underscores. * Start with a lowercase letter or an underscore. * Changing this parameter will create a new resource. */ userName?: pulumi.Input<string>; /** * Administrator password for logging in to a data warehouse cluster. * A password contains 8 to 32 characters, which consist of letters, digits, * and special characters(~!@#%^&*()-_=+|[{}];:,<.>/?). * It cannot be the same as the username or the username written in reverse order. */ userPwd?: pulumi.Input<string>; /** * The cluster version. * [For details](https://support.huaweicloud.com/intl/en-us/bulletin-dws/dws_12_0000.html). * Changing this parameter will create a new resource. */ version?: pulumi.Input<string>; /** * The information about the volume. * Changing this parameter will create a new resource. * For local disks, this parameter can not be specified. */ volume?: pulumi.Input<inputs.Dws.ClusterVolume>; /** * The VPC ID. * Changing this parameter will create a new resource. */ vpcId?: pulumi.Input<string>; } /** * The set of arguments for constructing a Cluster resource. */ export interface ClusterArgs { /** * The availability zone in which to create the cluster instance. * If there are multiple available zones, separate by commas, e.g. **cn-north-4a,cn-north-4b,cn-north-4g**. * Currently, multi-AZ clusters only support selecting `3` AZs. Changing this parameter will create a new resource. */ availabilityZone: pulumi.Input<string>; /** * Specifies the description of the cluster. */ description?: pulumi.Input<string>; /** * Dedicated storage pool ID. * Changing this parameter will create a new resource. */ dssPoolId?: pulumi.Input<string>; /** * Specifies the ID of the ELB load balancer. */ elbId?: pulumi.Input<string>; /** * The enterprise project ID. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specified whether to automatically execute snapshot when shrinking the number of nodes. * The default value is **true**. * This parameter is required and available only when scaling-in the `numberOfNode` parameter value. */ forceBackup?: pulumi.Input<boolean>; /** * The number of latest manual snapshots that need to be * retained when deleting the cluster. */ keepLastManualSnapshot?: pulumi.Input<number>; /** * The KMS key ID. * Changing this parameter will create a new resource. */ kmsKeyId?: pulumi.Input<string>; /** * Specifies whether to enable logical cluster. The switch needs to be turned * on before creating a logical cluster. */ logicalClusterEnable?: pulumi.Input<boolean>; /** * Specifies whether to enable LTS. The default value is **false**. */ ltsEnable?: pulumi.Input<boolean>; /** * Cluster name, which must be unique and contains 4 to 64 characters, which * consist of letters, digits, hyphens(-), or underscores(_) only and must start with a letter. * Changing this creates a new cluster resource. */ name?: pulumi.Input<string>; /** * The subnet ID. * Changing this parameter will create a new resource. */ networkId: pulumi.Input<string>; /** * The flavor of the cluster. * [For details](https://support.huaweicloud.com/intl/en-us/productdesc-dws/dws_01_00018.html). * Changing this parameter will create a new resource. */ nodeType: pulumi.Input<string>; /** * The number of CN. * The value ranges from 2 to **number_of_node**, the maximum value is 20. * This parameter must be used together with `version`. * Changing this parameter will create a new resource. */ numberOfCn?: pulumi.Input<number>; /** * Number of nodes in a cluster. * The value ranges from 3 to 256 in cluster mode. The value of stream warehouse(stand-alone mode) is 1. */ numberOfNode: pulumi.Input<number>; /** * Service port of a cluster (8000 to 10000). The default value is 8000. * Changing this parameter will create a new resource. */ port?: pulumi.Input<number>; /** * The information about public IP. */ publicIp?: pulumi.Input<inputs.Dws.ClusterPublicIp>; /** * Specifies the region in which to create the resource. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Specifies the security group ID of the cluster. * Changing this parameter will create a new resource. */ securityGroupId: pulumi.Input<string>; /** * The key/value pairs to associate with the cluster. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Administrator username for logging in to a data warehouse cluster. * The administrator username must: Consist of lowercase letters, digits, or underscores. * Start with a lowercase letter or an underscore. * Changing this parameter will create a new resource. */ userName: pulumi.Input<string>; /** * Administrator password for logging in to a data warehouse cluster. * A password contains 8 to 32 characters, which consist of letters, digits, * and special characters(~!@#%^&*()-_=+|[{}];:,<.>/?). * It cannot be the same as the username or the username written in reverse order. */ userPwd: pulumi.Input<string>; /** * The cluster version. * [For details](https://support.huaweicloud.com/intl/en-us/bulletin-dws/dws_12_0000.html). * Changing this parameter will create a new resource. */ version?: pulumi.Input<string>; /** * The information about the volume. * Changing this parameter will create a new resource. * For local disks, this parameter can not be specified. */ volume?: pulumi.Input<inputs.Dws.ClusterVolume>; /** * The VPC ID. * Changing this parameter will create a new resource. */ vpcId: pulumi.Input<string>; }