@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
698 lines (697 loc) • 27 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages dds instance resource within HuaweiCloud.
*
* ## Example Usage
* ### Creating A Cluster Community Edition
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const ddsPassword = config.requireObject("ddsPassword");
* const instance = new huaweicloud.dds.Instance("instance", {
* datastore: {
* type: "DDS-Community",
* version: "4.0",
* storageEngine: "wiredTiger",
* },
* availabilityZone: "{{ availability_zone }}",
* vpcId: "{{ vpc_id }}",
* subnetId: "{{ subnet_network_id }}}",
* securityGroupId: "{{ security_group_id }}",
* password: ddsPassword,
* mode: "Sharding",
* maintainBegin: "02:00",
* maintainEnd: "03:00",
* flavors: [
* {
* type: "mongos",
* num: 2,
* specCode: "dds.mongodb.c3.medium.4.mongos",
* },
* {
* type: "shard",
* num: 2,
* storage: "ULTRAHIGH",
* size: 20,
* specCode: "dds.mongodb.c3.medium.4.shard",
* },
* {
* type: "config",
* num: 1,
* storage: "ULTRAHIGH",
* size: 20,
* specCode: "dds.mongodb.c3.large.2.config",
* },
* ],
* backupStrategy: {
* startTime: "08:00-09:00",
* keepDays: 8,
* },
* });
* ```
* ### Creating A Replica Set Community Edition
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const ddsPassword = config.requireObject("ddsPassword");
* const instance = new huaweicloud.dds.Instance("instance", {
* datastore: {
* type: "DDS-Community",
* version: "4.0",
* storageEngine: "wiredTiger",
* },
* availabilityZone: "{{ availability_zone }}",
* vpcId: "{{ vpc_id }}",
* subnetId: "{{ subnet_network_id }}}",
* securityGroupId: "{{ security_group_id }}",
* password: ddsPassword,
* mode: "ReplicaSet",
* flavors: [{
* type: "replica",
* num: 3,
* storage: "ULTRAHIGH",
* size: 30,
* specCode: "dds.mongodb.c3.medium.4.repset",
* }],
* });
* ```
*
* ## Import
*
* DDS instance can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import huaweicloud:Dds/instance:Instance instance 9c6d6ff2cba3434293fd479571517e16in02
* ```
*
* 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`password`, `availability_zone`, `flavor`, configuration. 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_dds_instance" "instance" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* password, availability_zone, flavor, configuration,
*
* ]
*
* } }
*/
export declare class Instance extends pulumi.CustomResource {
/**
* Get an existing Instance 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?: InstanceState, opts?: pulumi.CustomResourceOptions): Instance;
/**
* Returns true if the given object is an instance of Instance. 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 Instance;
/**
* @deprecated Deprecated
*/
readonly autoPay: pulumi.Output<string | undefined>;
/**
* Specifies whether auto-renew is enabled.
* Valid values are `true` and `false`, defaults to `false`.
* Changing this creates a new instance.
*/
readonly autoRenew: pulumi.Output<string | undefined>;
/**
* Specifies the availability zone names separated by commas.
*/
readonly availabilityZone: pulumi.Output<string>;
/**
* Specifies the advanced backup policy. The structure is described below.
*/
readonly backupStrategy: pulumi.Output<outputs.Dds.InstanceBackupStrategy>;
/**
* Specifies the start time of the balancing activity time window.
* The format is **HH:MM**. It's required with `balancerActiveEnd`.
*/
readonly balancerActiveBegin: pulumi.Output<string | undefined>;
/**
* Specifies the end time of the balancing activity time window.
* The format is **HH:MM**. It's required with `balancerActiveBegin`.
*/
readonly balancerActiveEnd: pulumi.Output<string | undefined>;
/**
* Specifies the status of the balancer.
* The value can be **start** or **stop**. Defaults to **start**.
*/
readonly balancerStatus: pulumi.Output<string>;
/**
* Specifies the charging mode of the instance.
* The valid values are as follows:
* + `prePaid`: indicates the yearly/monthly billing mode.
* + `postPaid`: indicates the pay-per-use billing mode.
*/
readonly chargingMode: pulumi.Output<string>;
/**
* Specifies the CIDR block where the client is located. Cross-CIDR access is
* required only when the CIDR blocks of the client and the replica set instance are different. For example, if the client
* CIDR block is 192.168.0.0/16 and the replica set instance's CIDR block is 172.16.0.0/24, add the CIDR block
* 192.168.0.0/16 so that the client can access the replica set instance.
* It's only for replica set instance.
*/
readonly clientNetworkRanges: pulumi.Output<string[] | undefined>;
/**
* Specifies the configuration information.
* The structure is described below. Changing this creates a new instance.
*/
readonly configurations: pulumi.Output<outputs.Dds.InstanceConfiguration[] | undefined>;
/**
* Indicates the create time.
*/
readonly createdAt: pulumi.Output<string>;
/**
* Specifies database information. The structure is described below. Changing
* this creates a new instance.
*/
readonly datastore: pulumi.Output<outputs.Dds.InstanceDatastore>;
/**
* Indicates the DB Administrator name.
*/
readonly dbUsername: pulumi.Output<string>;
/**
* Specifies the description of the DDS instance.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Specifies the disk encryption ID of the instance. Changing this
* creates a new instance.
*/
readonly diskEncryptionId: pulumi.Output<string | undefined>;
/**
* Specifies the enterprise project id of the DDS instance.
*/
readonly enterpriseProjectId: pulumi.Output<string>;
/**
* Specifies the flavors information. The structure is described below. Changing
* this creates a new instance.
*/
readonly flavors: pulumi.Output<outputs.Dds.InstanceFlavor[]>;
/**
* Indicates the instance groups information.
* The groups structure is documented below.
*/
readonly groups: pulumi.Output<outputs.Dds.InstanceGroup[]>;
/**
* Specifies begin time of the time range within which you are allowed to start a
* task that affects the running of database instances. It must be a valid value in the format of **hh:mm** in UTC+0,
* such as **02:00**, meanwhile, this time in console displays in the format of **hh:mm** in UTC+08:00, e.g. **10:00**.
*/
readonly maintainBegin: pulumi.Output<string>;
/**
* Specifies end time of the time range within which you are allowed to start a
* task that affects the running of database instances. It must be a valid value in the format of **hh:mm** in UTC+0,
* such as **04:00**, meanwhile, this time in console displays in the format of **hh:mm** in UTC+08:00, e.g. **12:00**.
*/
readonly maintainEnd: pulumi.Output<string>;
/**
* Specifies the mode of the database instance. **Sharding**, **ReplicaSet**
* are supported. Changing this creates a new instance.
*/
readonly mode: pulumi.Output<string>;
/**
* Specifies the DB instance name. The DB instance name of the same type is unique in the
* same tenant.
*/
readonly name: pulumi.Output<string>;
/**
* Indicates the nodes info.
* The nodes structure is documented below.
*/
readonly nodes: pulumi.Output<outputs.Dds.InstanceNode[]>;
/**
* Specifies the Administrator password of the database instance.
*/
readonly password: pulumi.Output<string | undefined>;
/**
* Specifies the backup cycle. Data will be automatically backed up on the
* selected days every week.
* + If you set the `keepDays` to 0, this parameter is no need to set.
* + If you set the `keepDays` within 6 days, set the parameter value to **1,2,3,4,5,6,7**, data is automatically
* backed up on each day every week.
* + If you set the `keepDays` between 7 and 732 days, set the parameter value to at least one day of every week.
* For example: **1**, **3,5**.
*/
readonly period: pulumi.Output<number | undefined>;
/**
* Specifies the charging period unit of the instance.
* Valid values are *month* and *year*. This parameter is mandatory if `chargingMode` is set to *prePaid*.
* Changing this creates a new instance.
*/
readonly periodUnit: pulumi.Output<string | undefined>;
/**
* Specifies the database access port. The valid values are range from `2100` to `9500` and
* `27017`, `27018`, `27019`. Defaults to `8635`.
*/
readonly port: pulumi.Output<number>;
/**
* Specifies the region of the DDS instance. Changing this creates a new
* instance.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the name of the replica set in the connection address.
* It must be `3` to `128` characters long and start with a letter. It is case-sensitive and can contain only letters,
* digits, and underscores (_). Default is **replica**.
*/
readonly replicaSetName: pulumi.Output<string>;
/**
* Specifies whether to enable second level monitoring.
*/
readonly secondLevelMonitoringEnabled: pulumi.Output<boolean>;
/**
* Specifies the security group ID of the DDS instance.
*/
readonly securityGroupId: pulumi.Output<string>;
/**
* Specifies whether to enable slow original log.
* The value can be **on** or **off**.
*/
readonly slowLogDesensitization: pulumi.Output<string>;
/**
* Specifies whether to enable or disable SSL. Defaults to true.
*/
readonly ssl: pulumi.Output<boolean | undefined>;
/**
* Indicates the node status.
*/
readonly status: pulumi.Output<string>;
/**
* Specifies the subnet Network ID. Changing this creates a new instance.
*/
readonly subnetId: pulumi.Output<string>;
/**
* The key/value pairs to associate with the DDS instance.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Indicates the time zone.
*/
readonly timeZone: pulumi.Output<string>;
/**
* Indicates the update time.
*/
readonly updatedAt: pulumi.Output<string>;
/**
* Specifies the VPC ID. Changing this creates a new instance.
*/
readonly vpcId: pulumi.Output<string>;
/**
* Create a Instance 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: InstanceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Instance resources.
*/
export interface InstanceState {
/**
* @deprecated Deprecated
*/
autoPay?: pulumi.Input<string>;
/**
* Specifies whether auto-renew is enabled.
* Valid values are `true` and `false`, defaults to `false`.
* Changing this creates a new instance.
*/
autoRenew?: pulumi.Input<string>;
/**
* Specifies the availability zone names separated by commas.
*/
availabilityZone?: pulumi.Input<string>;
/**
* Specifies the advanced backup policy. The structure is described below.
*/
backupStrategy?: pulumi.Input<inputs.Dds.InstanceBackupStrategy>;
/**
* Specifies the start time of the balancing activity time window.
* The format is **HH:MM**. It's required with `balancerActiveEnd`.
*/
balancerActiveBegin?: pulumi.Input<string>;
/**
* Specifies the end time of the balancing activity time window.
* The format is **HH:MM**. It's required with `balancerActiveBegin`.
*/
balancerActiveEnd?: pulumi.Input<string>;
/**
* Specifies the status of the balancer.
* The value can be **start** or **stop**. Defaults to **start**.
*/
balancerStatus?: pulumi.Input<string>;
/**
* Specifies the charging mode of the instance.
* The valid values are as follows:
* + `prePaid`: indicates the yearly/monthly billing mode.
* + `postPaid`: indicates the pay-per-use billing mode.
*/
chargingMode?: pulumi.Input<string>;
/**
* Specifies the CIDR block where the client is located. Cross-CIDR access is
* required only when the CIDR blocks of the client and the replica set instance are different. For example, if the client
* CIDR block is 192.168.0.0/16 and the replica set instance's CIDR block is 172.16.0.0/24, add the CIDR block
* 192.168.0.0/16 so that the client can access the replica set instance.
* It's only for replica set instance.
*/
clientNetworkRanges?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the configuration information.
* The structure is described below. Changing this creates a new instance.
*/
configurations?: pulumi.Input<pulumi.Input<inputs.Dds.InstanceConfiguration>[]>;
/**
* Indicates the create time.
*/
createdAt?: pulumi.Input<string>;
/**
* Specifies database information. The structure is described below. Changing
* this creates a new instance.
*/
datastore?: pulumi.Input<inputs.Dds.InstanceDatastore>;
/**
* Indicates the DB Administrator name.
*/
dbUsername?: pulumi.Input<string>;
/**
* Specifies the description of the DDS instance.
*/
description?: pulumi.Input<string>;
/**
* Specifies the disk encryption ID of the instance. Changing this
* creates a new instance.
*/
diskEncryptionId?: pulumi.Input<string>;
/**
* Specifies the enterprise project id of the DDS instance.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the flavors information. The structure is described below. Changing
* this creates a new instance.
*/
flavors?: pulumi.Input<pulumi.Input<inputs.Dds.InstanceFlavor>[]>;
/**
* Indicates the instance groups information.
* The groups structure is documented below.
*/
groups?: pulumi.Input<pulumi.Input<inputs.Dds.InstanceGroup>[]>;
/**
* Specifies begin time of the time range within which you are allowed to start a
* task that affects the running of database instances. It must be a valid value in the format of **hh:mm** in UTC+0,
* such as **02:00**, meanwhile, this time in console displays in the format of **hh:mm** in UTC+08:00, e.g. **10:00**.
*/
maintainBegin?: pulumi.Input<string>;
/**
* Specifies end time of the time range within which you are allowed to start a
* task that affects the running of database instances. It must be a valid value in the format of **hh:mm** in UTC+0,
* such as **04:00**, meanwhile, this time in console displays in the format of **hh:mm** in UTC+08:00, e.g. **12:00**.
*/
maintainEnd?: pulumi.Input<string>;
/**
* Specifies the mode of the database instance. **Sharding**, **ReplicaSet**
* are supported. Changing this creates a new instance.
*/
mode?: pulumi.Input<string>;
/**
* Specifies the DB instance name. The DB instance name of the same type is unique in the
* same tenant.
*/
name?: pulumi.Input<string>;
/**
* Indicates the nodes info.
* The nodes structure is documented below.
*/
nodes?: pulumi.Input<pulumi.Input<inputs.Dds.InstanceNode>[]>;
/**
* Specifies the Administrator password of the database instance.
*/
password?: pulumi.Input<string>;
/**
* Specifies the backup cycle. Data will be automatically backed up on the
* selected days every week.
* + If you set the `keepDays` to 0, this parameter is no need to set.
* + If you set the `keepDays` within 6 days, set the parameter value to **1,2,3,4,5,6,7**, data is automatically
* backed up on each day every week.
* + If you set the `keepDays` between 7 and 732 days, set the parameter value to at least one day of every week.
* For example: **1**, **3,5**.
*/
period?: pulumi.Input<number>;
/**
* Specifies the charging period unit of the instance.
* Valid values are *month* and *year*. This parameter is mandatory if `chargingMode` is set to *prePaid*.
* Changing this creates a new instance.
*/
periodUnit?: pulumi.Input<string>;
/**
* Specifies the database access port. The valid values are range from `2100` to `9500` and
* `27017`, `27018`, `27019`. Defaults to `8635`.
*/
port?: pulumi.Input<number>;
/**
* Specifies the region of the DDS instance. Changing this creates a new
* instance.
*/
region?: pulumi.Input<string>;
/**
* Specifies the name of the replica set in the connection address.
* It must be `3` to `128` characters long and start with a letter. It is case-sensitive and can contain only letters,
* digits, and underscores (_). Default is **replica**.
*/
replicaSetName?: pulumi.Input<string>;
/**
* Specifies whether to enable second level monitoring.
*/
secondLevelMonitoringEnabled?: pulumi.Input<boolean>;
/**
* Specifies the security group ID of the DDS instance.
*/
securityGroupId?: pulumi.Input<string>;
/**
* Specifies whether to enable slow original log.
* The value can be **on** or **off**.
*/
slowLogDesensitization?: pulumi.Input<string>;
/**
* Specifies whether to enable or disable SSL. Defaults to true.
*/
ssl?: pulumi.Input<boolean>;
/**
* Indicates the node status.
*/
status?: pulumi.Input<string>;
/**
* Specifies the subnet Network ID. Changing this creates a new instance.
*/
subnetId?: pulumi.Input<string>;
/**
* The key/value pairs to associate with the DDS instance.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Indicates the time zone.
*/
timeZone?: pulumi.Input<string>;
/**
* Indicates the update time.
*/
updatedAt?: pulumi.Input<string>;
/**
* Specifies the VPC ID. Changing this creates a new instance.
*/
vpcId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Instance resource.
*/
export interface InstanceArgs {
/**
* @deprecated Deprecated
*/
autoPay?: pulumi.Input<string>;
/**
* Specifies whether auto-renew is enabled.
* Valid values are `true` and `false`, defaults to `false`.
* Changing this creates a new instance.
*/
autoRenew?: pulumi.Input<string>;
/**
* Specifies the availability zone names separated by commas.
*/
availabilityZone: pulumi.Input<string>;
/**
* Specifies the advanced backup policy. The structure is described below.
*/
backupStrategy?: pulumi.Input<inputs.Dds.InstanceBackupStrategy>;
/**
* Specifies the start time of the balancing activity time window.
* The format is **HH:MM**. It's required with `balancerActiveEnd`.
*/
balancerActiveBegin?: pulumi.Input<string>;
/**
* Specifies the end time of the balancing activity time window.
* The format is **HH:MM**. It's required with `balancerActiveBegin`.
*/
balancerActiveEnd?: pulumi.Input<string>;
/**
* Specifies the status of the balancer.
* The value can be **start** or **stop**. Defaults to **start**.
*/
balancerStatus?: pulumi.Input<string>;
/**
* Specifies the charging mode of the instance.
* The valid values are as follows:
* + `prePaid`: indicates the yearly/monthly billing mode.
* + `postPaid`: indicates the pay-per-use billing mode.
*/
chargingMode?: pulumi.Input<string>;
/**
* Specifies the CIDR block where the client is located. Cross-CIDR access is
* required only when the CIDR blocks of the client and the replica set instance are different. For example, if the client
* CIDR block is 192.168.0.0/16 and the replica set instance's CIDR block is 172.16.0.0/24, add the CIDR block
* 192.168.0.0/16 so that the client can access the replica set instance.
* It's only for replica set instance.
*/
clientNetworkRanges?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Specifies the configuration information.
* The structure is described below. Changing this creates a new instance.
*/
configurations?: pulumi.Input<pulumi.Input<inputs.Dds.InstanceConfiguration>[]>;
/**
* Specifies database information. The structure is described below. Changing
* this creates a new instance.
*/
datastore: pulumi.Input<inputs.Dds.InstanceDatastore>;
/**
* Specifies the description of the DDS instance.
*/
description?: pulumi.Input<string>;
/**
* Specifies the disk encryption ID of the instance. Changing this
* creates a new instance.
*/
diskEncryptionId?: pulumi.Input<string>;
/**
* Specifies the enterprise project id of the DDS instance.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the flavors information. The structure is described below. Changing
* this creates a new instance.
*/
flavors: pulumi.Input<pulumi.Input<inputs.Dds.InstanceFlavor>[]>;
/**
* Specifies begin time of the time range within which you are allowed to start a
* task that affects the running of database instances. It must be a valid value in the format of **hh:mm** in UTC+0,
* such as **02:00**, meanwhile, this time in console displays in the format of **hh:mm** in UTC+08:00, e.g. **10:00**.
*/
maintainBegin?: pulumi.Input<string>;
/**
* Specifies end time of the time range within which you are allowed to start a
* task that affects the running of database instances. It must be a valid value in the format of **hh:mm** in UTC+0,
* such as **04:00**, meanwhile, this time in console displays in the format of **hh:mm** in UTC+08:00, e.g. **12:00**.
*/
maintainEnd?: pulumi.Input<string>;
/**
* Specifies the mode of the database instance. **Sharding**, **ReplicaSet**
* are supported. Changing this creates a new instance.
*/
mode: pulumi.Input<string>;
/**
* Specifies the DB instance name. The DB instance name of the same type is unique in the
* same tenant.
*/
name?: pulumi.Input<string>;
/**
* Specifies the Administrator password of the database instance.
*/
password?: pulumi.Input<string>;
/**
* Specifies the backup cycle. Data will be automatically backed up on the
* selected days every week.
* + If you set the `keepDays` to 0, this parameter is no need to set.
* + If you set the `keepDays` within 6 days, set the parameter value to **1,2,3,4,5,6,7**, data is automatically
* backed up on each day every week.
* + If you set the `keepDays` between 7 and 732 days, set the parameter value to at least one day of every week.
* For example: **1**, **3,5**.
*/
period?: pulumi.Input<number>;
/**
* Specifies the charging period unit of the instance.
* Valid values are *month* and *year*. This parameter is mandatory if `chargingMode` is set to *prePaid*.
* Changing this creates a new instance.
*/
periodUnit?: pulumi.Input<string>;
/**
* Specifies the database access port. The valid values are range from `2100` to `9500` and
* `27017`, `27018`, `27019`. Defaults to `8635`.
*/
port?: pulumi.Input<number>;
/**
* Specifies the region of the DDS instance. Changing this creates a new
* instance.
*/
region?: pulumi.Input<string>;
/**
* Specifies the name of the replica set in the connection address.
* It must be `3` to `128` characters long and start with a letter. It is case-sensitive and can contain only letters,
* digits, and underscores (_). Default is **replica**.
*/
replicaSetName?: pulumi.Input<string>;
/**
* Specifies whether to enable second level monitoring.
*/
secondLevelMonitoringEnabled?: pulumi.Input<boolean>;
/**
* Specifies the security group ID of the DDS instance.
*/
securityGroupId: pulumi.Input<string>;
/**
* Specifies whether to enable slow original log.
* The value can be **on** or **off**.
*/
slowLogDesensitization?: pulumi.Input<string>;
/**
* Specifies whether to enable or disable SSL. Defaults to true.
*/
ssl?: pulumi.Input<boolean>;
/**
* Specifies the subnet Network ID. Changing this creates a new instance.
*/
subnetId: pulumi.Input<string>;
/**
* The key/value pairs to associate with the DDS instance.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Specifies the VPC ID. Changing this creates a new instance.
*/
vpcId: pulumi.Input<string>;
}