@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
347 lines (346 loc) • 13.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages CDM cluster resource within HuaweiCloud.
*
* ## Example Usage
* ### create a cdm cluster
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const name = config.requireObject("name");
* const flavorId = config.requireObject("flavorId");
* const availabilityZone = config.requireObject("availabilityZone");
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const secgroupId = config.requireObject("secgroupId");
* const test = huaweicloud.Cdm.getFlavors({});
* const cluster = new huaweicloud.cdm.Cluster("cluster", {
* availabilityZone: availabilityZone,
* flavorId: test.then(test => test.flavors?[0]?.id),
* subnetId: subnetId,
* vpcId: vpcId,
* securityGroupId: secgroupId,
* });
* ```
*
* ## Import
*
* Clusters can be imported by `id`. For example, bash
*
* ```sh
* $ pulumi import huaweicloud:Cdm/cluster:Cluster test b11b407c-e604-4e8d-8bc4-92398320b847
* ```
*
* 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`email` and `phone_num`.
*
* 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_cdm_cluster" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* email, phone_num,
*
* ]
*
* } }
*/
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;
/**
* Specifies available zone.
* Changing this parameter will create a new resource.
*/
readonly availabilityZone: pulumi.Output<string>;
/**
* Create time. The format is: `YYYY-MM-DDThh:mm:ss`.
*/
readonly created: pulumi.Output<string>;
/**
* Specifies email address for receiving notifications when a table/file migration
* job fails or an EIP exception occurs. The max number is 20.
*/
readonly emails: pulumi.Output<string[] | undefined>;
/**
* Specifies the enterprise project id.
*/
readonly enterpriseProjectId: pulumi.Output<string>;
/**
* Specifies flavor id. Changing this parameter will create a new resource.
*/
readonly flavorId: pulumi.Output<string>;
/**
* The flavor name. Format is `cdm.<flavor_type>`
*/
readonly flavorName: pulumi.Output<string>;
/**
* Instance list. Structure is documented below.
*/
readonly instances: pulumi.Output<outputs.Cdm.ClusterInstance[]>;
/**
* Specifies Whether to enable auto shutdown. The auto shutdown and scheduled
* startup/shutdown functions cannot be enabled at the same time. When auto shutdown is enabled, if no job is running in
* the cluster and no scheduled job is created, a cluster will be automatically shut down 15 minutes after it starts
* running to reduce costs. The default value is `false`. Changing this parameter will create a new resource.
*/
readonly isAutoOff: pulumi.Output<boolean>;
/**
* Specifies cluster name. Changing this parameter will create a new resource.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies phone number for receiving notifications when a table/file
* migration job fails or an EIP exception occurs. The max number is 20.
*/
readonly phoneNums: pulumi.Output<string[] | undefined>;
/**
* EIP bound to the cluster.
*/
readonly publicEndpoint: pulumi.Output<string>;
/**
* Public IP.
*/
readonly publicIp: pulumi.Output<string>;
/**
* The region in which to create the cluster resource. If omitted, the
* provider-level region will be used. Changing this parameter will create a new resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies time for scheduled startup of a CDM cluster.
* The CDM cluster starts at this time every day. The scheduled startup/shutdown and auto shutdown function cannot be
* enabled at the same time. The time format is `hh:mm:ss`. Changing this parameter will create a new resource.
*/
readonly scheduleBootTime: pulumi.Output<string>;
/**
* Specifies time for scheduled shutdown of a CDM cluster.
* The system shuts down directly at this time every day without waiting for unfinished jobs to complete.
* The scheduled startup/shutdown and auto shutdown function cannot be enabled at the same time.
* The time format is `hh:mm:ss`. Changing this parameter will create a new resource.
*/
readonly scheduleOffTime: pulumi.Output<string>;
/**
* Specifies security group ID.
* Changing this parameter will create a new resource.
*/
readonly securityGroupId: pulumi.Output<string>;
/**
* Status.
*/
readonly status: pulumi.Output<string>;
/**
* Specifies subnet ID. Changing this parameter will create a new resource.
*/
readonly subnetId: pulumi.Output<string>;
/**
* Specifies the cluster version. Changing this parameter will create a new resource.
*/
readonly version: pulumi.Output<string>;
/**
* Specifies 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 {
/**
* Specifies available zone.
* Changing this parameter will create a new resource.
*/
availabilityZone?: pulumi.Input<string>;
/**
* Create time. The format is: `YYYY-MM-DDThh:mm:ss`.
*/
created?: pulumi.Input<string>;
/**
* Specifies email address for receiving notifications when a table/file migration
* job fails or an EIP exception occurs. The max number is 20.
*/
emails?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the enterprise project id.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies flavor id. Changing this parameter will create a new resource.
*/
flavorId?: pulumi.Input<string>;
/**
* The flavor name. Format is `cdm.<flavor_type>`
*/
flavorName?: pulumi.Input<string>;
/**
* Instance list. Structure is documented below.
*/
instances?: pulumi.Input<pulumi.Input<inputs.Cdm.ClusterInstance>[]>;
/**
* Specifies Whether to enable auto shutdown. The auto shutdown and scheduled
* startup/shutdown functions cannot be enabled at the same time. When auto shutdown is enabled, if no job is running in
* the cluster and no scheduled job is created, a cluster will be automatically shut down 15 minutes after it starts
* running to reduce costs. The default value is `false`. Changing this parameter will create a new resource.
*/
isAutoOff?: pulumi.Input<boolean>;
/**
* Specifies cluster name. Changing this parameter will create a new resource.
*/
name?: pulumi.Input<string>;
/**
* Specifies phone number for receiving notifications when a table/file
* migration job fails or an EIP exception occurs. The max number is 20.
*/
phoneNums?: pulumi.Input<pulumi.Input<string>[]>;
/**
* EIP bound to the cluster.
*/
publicEndpoint?: pulumi.Input<string>;
/**
* Public IP.
*/
publicIp?: pulumi.Input<string>;
/**
* The region in which to create the cluster resource. If omitted, the
* provider-level region will be used. Changing this parameter will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies time for scheduled startup of a CDM cluster.
* The CDM cluster starts at this time every day. The scheduled startup/shutdown and auto shutdown function cannot be
* enabled at the same time. The time format is `hh:mm:ss`. Changing this parameter will create a new resource.
*/
scheduleBootTime?: pulumi.Input<string>;
/**
* Specifies time for scheduled shutdown of a CDM cluster.
* The system shuts down directly at this time every day without waiting for unfinished jobs to complete.
* The scheduled startup/shutdown and auto shutdown function cannot be enabled at the same time.
* The time format is `hh:mm:ss`. Changing this parameter will create a new resource.
*/
scheduleOffTime?: pulumi.Input<string>;
/**
* Specifies security group ID.
* Changing this parameter will create a new resource.
*/
securityGroupId?: pulumi.Input<string>;
/**
* Status.
*/
status?: pulumi.Input<string>;
/**
* Specifies subnet ID. Changing this parameter will create a new resource.
*/
subnetId?: pulumi.Input<string>;
/**
* Specifies the cluster version. Changing this parameter will create a new resource.
*/
version?: pulumi.Input<string>;
/**
* Specifies 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 {
/**
* Specifies available zone.
* Changing this parameter will create a new resource.
*/
availabilityZone: pulumi.Input<string>;
/**
* Specifies email address for receiving notifications when a table/file migration
* job fails or an EIP exception occurs. The max number is 20.
*/
emails?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the enterprise project id.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies flavor id. Changing this parameter will create a new resource.
*/
flavorId: pulumi.Input<string>;
/**
* Specifies Whether to enable auto shutdown. The auto shutdown and scheduled
* startup/shutdown functions cannot be enabled at the same time. When auto shutdown is enabled, if no job is running in
* the cluster and no scheduled job is created, a cluster will be automatically shut down 15 minutes after it starts
* running to reduce costs. The default value is `false`. Changing this parameter will create a new resource.
*/
isAutoOff?: pulumi.Input<boolean>;
/**
* Specifies cluster name. Changing this parameter will create a new resource.
*/
name?: pulumi.Input<string>;
/**
* Specifies phone number for receiving notifications when a table/file
* migration job fails or an EIP exception occurs. The max number is 20.
*/
phoneNums?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The region in which to create the cluster resource. If omitted, the
* provider-level region will be used. Changing this parameter will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies time for scheduled startup of a CDM cluster.
* The CDM cluster starts at this time every day. The scheduled startup/shutdown and auto shutdown function cannot be
* enabled at the same time. The time format is `hh:mm:ss`. Changing this parameter will create a new resource.
*/
scheduleBootTime?: pulumi.Input<string>;
/**
* Specifies time for scheduled shutdown of a CDM cluster.
* The system shuts down directly at this time every day without waiting for unfinished jobs to complete.
* The scheduled startup/shutdown and auto shutdown function cannot be enabled at the same time.
* The time format is `hh:mm:ss`. Changing this parameter will create a new resource.
*/
scheduleOffTime?: pulumi.Input<string>;
/**
* Specifies security group ID.
* Changing this parameter will create a new resource.
*/
securityGroupId: pulumi.Input<string>;
/**
* Specifies subnet ID. Changing this parameter will create a new resource.
*/
subnetId: pulumi.Input<string>;
/**
* Specifies the cluster version. Changing this parameter will create a new resource.
*/
version?: pulumi.Input<string>;
/**
* Specifies VPC ID. Changing this parameter will create a new resource.
*/
vpcId: pulumi.Input<string>;
}