This page documents the language specification for the alicloud package. If you're looking for help working with the inputs, outputs, or functions of alicloud resources in a Pulumi program, please see the resource documentation for examples and API reference.

polardb

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-alicloud repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-alicloud repo.

class pulumi_alicloud.polardb.Account(resource_name, opts=None, account_description=None, account_name=None, account_password=None, account_type=None, db_cluster_id=None, kms_encrypted_password=None, kms_encryption_context=None, __props__=None, __name__=None, __opts__=None)

Provides a PolarDB account resource and used to manage databases.

NOTE: Available in v1.67.0+.

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
creation = config.get("creation")
if creation is None:
    creation = "PolarDB"
name = config.get("name")
if name is None:
    name = "polardbaccountmysql"
default_zones = alicloud.get_zones(available_resource_creation=creation)
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/24",
    vpc_id=default_network.id)
cluster = alicloud.polardb.Cluster("cluster",
    db_node_class="polar.mysql.x4.large",
    db_type="MySQL",
    db_version="8.0",
    description=name,
    pay_type="PostPaid",
    vswitch_id=default_switch.id)
account = alicloud.rds.Account("account",
    account_description=name,
    account_name="tftestnormal",
    account_password="Test12345",
    db_cluster_id=alicloud_db_instance["cluster"]["id"])
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • account*description (pulumi.Input[str]) –

    Account description. It cannot begin with https://. It must start with a Chinese character or English letter. It can include Chinese and English characters, underlines (*), hyphens (-), and numbers. The length may be 2-256 characters.

  • account_name (pulumi.Input[str]) – Operation account requiring a uniqueness check. It may consist of lower case letters, numbers, and underlines, and must start with a letter and have no more than 16 characters.

  • account_password (pulumi.Input[str]) – Operation password. It may consist of letters, digits, or underlines, with a length of 6 to 32 characters.

  • account_type (pulumi.Input[str]) – Account type, Valid values are Normal, Super, Default to Normal.

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster in which account belongs.

  • kms_encrypted_password (pulumi.Input[str]) – An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.

  • kms_encryption_context (pulumi.Input[dict]) – An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.

account_description: pulumi.Output[str] = None

Account description. It cannot begin with https://. It must start with a Chinese character or English letter. It can include Chinese and English characters, underlines (_), hyphens (-), and numbers. The length may be 2-256 characters.

account_name: pulumi.Output[str] = None

Operation account requiring a uniqueness check. It may consist of lower case letters, numbers, and underlines, and must start with a letter and have no more than 16 characters.

account_password: pulumi.Output[str] = None

Operation password. It may consist of letters, digits, or underlines, with a length of 6 to 32 characters.

account_type: pulumi.Output[str] = None

Account type, Valid values are Normal, Super, Default to Normal.

db_cluster_id: pulumi.Output[str] = None

The Id of cluster in which account belongs.

kms_encrypted_password: pulumi.Output[str] = None

An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.

kms_encryption_context: pulumi.Output[dict] = None

An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.

static get(resource_name, id, opts=None, account_description=None, account_name=None, account_password=None, account_type=None, db_cluster_id=None, kms_encrypted_password=None, kms_encryption_context=None)

Get an existing Account resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • account*description (pulumi.Input[str]) –

    Account description. It cannot begin with https://. It must start with a Chinese character or English letter. It can include Chinese and English characters, underlines (*), hyphens (-), and numbers. The length may be 2-256 characters.

  • account_name (pulumi.Input[str]) – Operation account requiring a uniqueness check. It may consist of lower case letters, numbers, and underlines, and must start with a letter and have no more than 16 characters.

  • account_password (pulumi.Input[str]) – Operation password. It may consist of letters, digits, or underlines, with a length of 6 to 32 characters.

  • account_type (pulumi.Input[str]) – Account type, Valid values are Normal, Super, Default to Normal.

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster in which account belongs.

  • kms_encrypted_password (pulumi.Input[str]) – An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.

  • kms_encryption_context (pulumi.Input[dict]) –

    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.polardb.AccountPrivilege(resource_name, opts=None, account_name=None, account_privilege=None, db_cluster_id=None, db_names=None, __props__=None, __name__=None, __opts__=None)

Provides a PolarDB account privilege resource and used to grant several database some access privilege. A database can be granted by multiple account.

NOTE: Available in v1.67.0+.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • account_name (pulumi.Input[str]) – A specified account name.

  • account_privilege (pulumi.Input[str]) – The privilege of one account access database. Valid values: [“ReadOnly”, “ReadWrite”]. Default to “ReadOnly”.

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster in which account belongs.

  • db_names (pulumi.Input[list]) – List of specified database name.

account_name: pulumi.Output[str] = None

A specified account name.

account_privilege: pulumi.Output[str] = None

The privilege of one account access database. Valid values: [“ReadOnly”, “ReadWrite”]. Default to “ReadOnly”.

db_cluster_id: pulumi.Output[str] = None

The Id of cluster in which account belongs.

db_names: pulumi.Output[list] = None

List of specified database name.

static get(resource_name, id, opts=None, account_name=None, account_privilege=None, db_cluster_id=None, db_names=None)

Get an existing AccountPrivilege resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • account_name (pulumi.Input[str]) – A specified account name.

  • account_privilege (pulumi.Input[str]) – The privilege of one account access database. Valid values: [“ReadOnly”, “ReadWrite”]. Default to “ReadOnly”.

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster in which account belongs.

  • db_names (pulumi.Input[list]) – List of specified database name.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.polardb.AwaitableGetAccountsResult(accounts=None, db_cluster_id=None, id=None, name_regex=None, names=None)
class pulumi_alicloud.polardb.AwaitableGetClustersResult(clusters=None, db_type=None, description_regex=None, descriptions=None, id=None, ids=None, output_file=None, status=None, tags=None)
class pulumi_alicloud.polardb.AwaitableGetDatabasesResult(databases=None, db_cluster_id=None, id=None, name_regex=None, names=None)
class pulumi_alicloud.polardb.AwaitableGetEndpointsResult(db_cluster_id=None, db_endpoint_id=None, endpoints=None, id=None)
class pulumi_alicloud.polardb.AwaitableGetNodeClassesResult(classes=None, db_node_class=None, db_type=None, db_version=None, id=None, output_file=None, pay_type=None, region_id=None, zone_id=None)
class pulumi_alicloud.polardb.AwaitableGetZonesResult(id=None, ids=None, multi=None, output_file=None, zones=None)
class pulumi_alicloud.polardb.BackupPolicy(resource_name, opts=None, db_cluster_id=None, preferred_backup_periods=None, preferred_backup_time=None, __props__=None, __name__=None, __opts__=None)

Create a BackupPolicy resource with the given unique name, props, and options. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] db_cluster_id: The Id of cluster that can run database. :param pulumi.Input[list] preferred_backup_periods: PolarDB Cluster backup period. Valid values: [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday]. Default to [“Tuesday”, “Thursday”, “Saturday”]. :param pulumi.Input[str] preferred_backup_time: PolarDB Cluster backup time, in the format of HH:mmZ- HH:mmZ. Time setting interval is one hour. Default to “02:00Z-03:00Z”. China time is 8 hours behind it.

backup_retention_period: pulumi.Output[str] = None

Cluster backup retention days, Fixed for 7 days, not modified.

db_cluster_id: pulumi.Output[str] = None

The Id of cluster that can run database.

preferred_backup_periods: pulumi.Output[list] = None

PolarDB Cluster backup period. Valid values: [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday]. Default to [“Tuesday”, “Thursday”, “Saturday”].

preferred_backup_time: pulumi.Output[str] = None

PolarDB Cluster backup time, in the format of HH:mmZ- HH:mmZ. Time setting interval is one hour. Default to “02:00Z-03:00Z”. China time is 8 hours behind it.

static get(resource_name, id, opts=None, backup_retention_period=None, db_cluster_id=None, preferred_backup_periods=None, preferred_backup_time=None)

Get an existing BackupPolicy resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • backup_retention_period (pulumi.Input[str]) – Cluster backup retention days, Fixed for 7 days, not modified.

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster that can run database.

  • preferred_backup_periods (pulumi.Input[list]) – PolarDB Cluster backup period. Valid values: [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday]. Default to [“Tuesday”, “Thursday”, “Saturday”].

  • preferred_backup_time (pulumi.Input[str]) – PolarDB Cluster backup time, in the format of HH:mmZ- HH:mmZ. Time setting interval is one hour. Default to “02:00Z-03:00Z”. China time is 8 hours behind it.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.polardb.Cluster(resource_name, opts=None, auto_renew_period=None, db_node_class=None, db_type=None, db_version=None, description=None, maintain_time=None, modify_type=None, parameters=None, pay_type=None, period=None, renewal_status=None, security_ips=None, tags=None, vswitch_id=None, zone_id=None, __props__=None, __name__=None, __opts__=None)

Provides a PolarDB cluster resource. A PolarDB cluster is an isolated database environment in the cloud. A PolarDB cluster can contain multiple user-created databases.

NOTE: Available in v1.66.0+.

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "polardbClusterconfig"
creation = config.get("creation")
if creation is None:
    creation = "PolarDB"
default_zones = alicloud.get_zones(available_resource_creation=creation)
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/24",
    vpc_id=default_network.id)
default_cluster = alicloud.polardb.Cluster("defaultCluster",
    db_node_class="rds.mysql.s2.large",
    db_type="MySQL",
    db_version="5.6",
    description=name,
    pay_type="PostPaid",
    vswitch_id=default_switch.id)
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • auto_renew_period (pulumi.Input[float]) – Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

  • db_node_class (pulumi.Input[str]) – The db_node_class of cluster node.

  • db_type (pulumi.Input[str]) – Database type. Value options: MySQL, Oracle, PostgreSQL.

  • db_version (pulumi.Input[str]) – Database version. Value options can refer to the latest docs CreateDBCluster DBVersion.

  • description (pulumi.Input[str]) – The description of cluster.

  • maintain_time (pulumi.Input[str]) – Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

  • modify_type (pulumi.Input[str]) – Use as db_node_class change class , define upgrade or downgrade. Valid values are Upgrade, Downgrade, Default to Upgrade.

  • parameters (pulumi.Input[list]) – Set of parameters needs to be set after DB cluster was launched. Available parameters can refer to the latest docs View database parameter templates .

  • pay_type (pulumi.Input[str]) – Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

  • period (pulumi.Input[float]) – The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

  • renewal_status (pulumi.Input[str]) – Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

  • security_ips (pulumi.Input[list]) – List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
Parameters
  • vswitch_id (pulumi.Input[str]) – The virtual switch ID to launch DB instances in one VPC.

  • zone_id (pulumi.Input[str]) – The Zone to launch the DB cluster. it supports multiple zone.

The parameters object supports the following:

  • name (pulumi.Input[str])

  • value (pulumi.Input[str])

auto_renew_period: pulumi.Output[float] = None

Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

connection_string: pulumi.Output[str] = None

(Available in 1.81.0+) PolarDB cluster connection string. When security_ips is configured, the address of cluster type endpoint will be returned, and if only “127.0.0.1” is configured, it will also be an empty string.

db_node_class: pulumi.Output[str] = None

The db_node_class of cluster node.

db_type: pulumi.Output[str] = None

Database type. Value options: MySQL, Oracle, PostgreSQL.

db_version: pulumi.Output[str] = None

Database version. Value options can refer to the latest docs CreateDBCluster DBVersion.

description: pulumi.Output[str] = None

The description of cluster.

maintain_time: pulumi.Output[str] = None

Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

modify_type: pulumi.Output[str] = None

Use as db_node_class change class , define upgrade or downgrade. Valid values are Upgrade, Downgrade, Default to Upgrade.

parameters: pulumi.Output[list] = None

Set of parameters needs to be set after DB cluster was launched. Available parameters can refer to the latest docs View database parameter templates .

  • name (str)

  • value (str)

pay_type: pulumi.Output[str] = None

Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

period: pulumi.Output[float] = None

The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

renewal_status: pulumi.Output[str] = None

Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

security_ips: pulumi.Output[list] = None

List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

tags: pulumi.Output[dict] = None

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with “aliyun”, “acs:”, “http://”, or “https://”. It cannot be a null string.

  • Value: It can be up to 128 characters in length. It cannot begin with “aliyun”, “acs:”, “http://”, or “https://”. It can be a null string.

vswitch_id: pulumi.Output[str] = None

The virtual switch ID to launch DB instances in one VPC.

zone_id: pulumi.Output[str] = None

The Zone to launch the DB cluster. it supports multiple zone.

static get(resource_name, id, opts=None, auto_renew_period=None, connection_string=None, db_node_class=None, db_type=None, db_version=None, description=None, maintain_time=None, modify_type=None, parameters=None, pay_type=None, period=None, renewal_status=None, security_ips=None, tags=None, vswitch_id=None, zone_id=None)

Get an existing Cluster resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • auto_renew_period (pulumi.Input[float]) – Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

  • connection_string (pulumi.Input[str]) – (Available in 1.81.0+) PolarDB cluster connection string. When security_ips is configured, the address of cluster type endpoint will be returned, and if only “127.0.0.1” is configured, it will also be an empty string.

  • db_node_class (pulumi.Input[str]) – The db_node_class of cluster node.

  • db_type (pulumi.Input[str]) – Database type. Value options: MySQL, Oracle, PostgreSQL.

  • db_version (pulumi.Input[str]) –

    Database version. Value options can refer to the latest docs CreateDBCluster DBVersion.

  • description (pulumi.Input[str]) – The description of cluster.

  • maintain_time (pulumi.Input[str]) – Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

  • modify_type (pulumi.Input[str]) – Use as db_node_class change class , define upgrade or downgrade. Valid values are Upgrade, Downgrade, Default to Upgrade.

  • parameters (pulumi.Input[list]) –

    Set of parameters needs to be set after DB cluster was launched. Available parameters can refer to the latest docs View database parameter templates .

  • pay_type (pulumi.Input[str]) – Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

  • period (pulumi.Input[float]) – The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

  • renewal_status (pulumi.Input[str]) – Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

  • security_ips (pulumi.Input[list]) – List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

  • tags (pulumi.Input[dict]) – A mapping of tags to assign to the resource.

- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
Parameters
  • vswitch_id (pulumi.Input[str]) – The virtual switch ID to launch DB instances in one VPC.

  • zone_id (pulumi.Input[str]) – The Zone to launch the DB cluster. it supports multiple zone.

The parameters object supports the following:

  • name (pulumi.Input[str])

  • value (pulumi.Input[str])

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.polardb.Database(resource_name, opts=None, character_set_name=None, db_cluster_id=None, db_description=None, db_name=None, __props__=None, __name__=None, __opts__=None)

Provides a PolarDB database resource. A DB database deployed in a DB cluster. A DB cluster can own multiple databases.

NOTE: Available in v1.66.0+.

import pulumi
import pulumi_alicloud as alicloud

cluster = alicloud.polardb.Cluster("cluster",
    db_node_class=var["clusterclass"],
    db_type="MySQL",
    db_version="8.0",
    description="testDB",
    pay_type="PostPaid",
    vswitch_id="polar.mysql.x4.large")
default = alicloud.polardb.Database("default",
    db_cluster_id=cluster.id,
    db_name="tftestdatabase")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • character_set_name (pulumi.Input[str]) – Character set. The value range is limited to the following: [ utf8, gbk, latin1, utf8mb4, Chinese_PRC_CI_AS, Chinese_PRC_CS_AS, SQL_Latin1_General_CP1_CI_AS, SQL_Latin1_General_CP1_CS_AS, Chinese_PRC_BIN ], default is “utf8” (utf8mb4 only supports versions 5.5 and 5.6).

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster that can run database.

  • db*description (pulumi.Input[str]) –

    Database description. It cannot begin with https://. It must start with a Chinese character or English letter. It can include Chinese and English characters, underlines (*), hyphens (-), and numbers. The length may be 2-256 characters.

  • db_name (pulumi.Input[str]) – Name of the database requiring a uniqueness check. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.

character_set_name: pulumi.Output[str] = None

Character set. The value range is limited to the following: [ utf8, gbk, latin1, utf8mb4, Chinese_PRC_CI_AS, Chinese_PRC_CS_AS, SQL_Latin1_General_CP1_CI_AS, SQL_Latin1_General_CP1_CS_AS, Chinese_PRC_BIN ], default is “utf8” (utf8mb4 only supports versions 5.5 and 5.6).

db_cluster_id: pulumi.Output[str] = None

The Id of cluster that can run database.

db_description: pulumi.Output[str] = None

Database description. It cannot begin with https://. It must start with a Chinese character or English letter. It can include Chinese and English characters, underlines (_), hyphens (-), and numbers. The length may be 2-256 characters.

db_name: pulumi.Output[str] = None

Name of the database requiring a uniqueness check. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.

static get(resource_name, id, opts=None, character_set_name=None, db_cluster_id=None, db_description=None, db_name=None)

Get an existing Database resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • character_set_name (pulumi.Input[str]) – Character set. The value range is limited to the following: [ utf8, gbk, latin1, utf8mb4, Chinese_PRC_CI_AS, Chinese_PRC_CS_AS, SQL_Latin1_General_CP1_CI_AS, SQL_Latin1_General_CP1_CS_AS, Chinese_PRC_BIN ], default is “utf8” (utf8mb4 only supports versions 5.5 and 5.6).

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster that can run database.

  • db*description (pulumi.Input[str]) –

    Database description. It cannot begin with https://. It must start with a Chinese character or English letter. It can include Chinese and English characters, underlines (*), hyphens (-), and numbers. The length may be 2-256 characters.

  • db_name (pulumi.Input[str]) – Name of the database requiring a uniqueness check. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.polardb.Endpoint(resource_name, opts=None, auto_add_new_nodes=None, db_cluster_id=None, endpoint_config=None, endpoint_type=None, nodes=None, read_write_mode=None, __props__=None, __name__=None, __opts__=None)

Provides a PolarDB endpoint resource to allocate an Internet endpoint string for PolarDB instance.

NOTE: Available in v1.80.0+. Each PolarDB instance will allocate a intranet connection string automatically and its prefix is Cluster ID.

To avoid unnecessary conflict, please specified a internet connection prefix before applying the resource.

Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • auto_add_new_nodes (pulumi.Input[str]) – Whether the new node automatically joins the default cluster address. Valid values are Enable, Disable. Default to Disable.

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster that can run database.

  • endpoint_config (pulumi.Input[dict]) – Advanced configuration of the cluster address.

  • endpoint_type (pulumi.Input[str]) – Type of endpoint. Valid value: Custom. Currently supported only Custom.

  • nodes (pulumi.Input[list]) – Node id list for endpoint configuration. At least 2 nodes if specified, or if the cluster has more than 3 nodes, read-only endpoint is allowed to mount only one node. Default is all nodes.

  • read_write_mode (pulumi.Input[str]) – Read or write mode. Valid values are ReadWrite, ReadOnly. Default to ReadOnly.

auto_add_new_nodes: pulumi.Output[str] = None

Whether the new node automatically joins the default cluster address. Valid values are Enable, Disable. Default to Disable.

db_cluster_id: pulumi.Output[str] = None

The Id of cluster that can run database.

endpoint_config: pulumi.Output[dict] = None

Advanced configuration of the cluster address.

endpoint_type: pulumi.Output[str] = None

Type of endpoint. Valid value: Custom. Currently supported only Custom.

nodes: pulumi.Output[list] = None

Node id list for endpoint configuration. At least 2 nodes if specified, or if the cluster has more than 3 nodes, read-only endpoint is allowed to mount only one node. Default is all nodes.

read_write_mode: pulumi.Output[str] = None

Read or write mode. Valid values are ReadWrite, ReadOnly. Default to ReadOnly.

static get(resource_name, id, opts=None, auto_add_new_nodes=None, db_cluster_id=None, endpoint_config=None, endpoint_type=None, nodes=None, read_write_mode=None)

Get an existing Endpoint resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • auto_add_new_nodes (pulumi.Input[str]) – Whether the new node automatically joins the default cluster address. Valid values are Enable, Disable. Default to Disable.

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster that can run database.

  • endpoint_config (pulumi.Input[dict]) – Advanced configuration of the cluster address.

  • endpoint_type (pulumi.Input[str]) – Type of endpoint. Valid value: Custom. Currently supported only Custom.

  • nodes (pulumi.Input[list]) – Node id list for endpoint configuration. At least 2 nodes if specified, or if the cluster has more than 3 nodes, read-only endpoint is allowed to mount only one node. Default is all nodes.

  • read_write_mode (pulumi.Input[str]) – Read or write mode. Valid values are ReadWrite, ReadOnly. Default to ReadOnly.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.polardb.EndpointAddress(resource_name, opts=None, connection_prefix=None, db_cluster_id=None, db_endpoint_id=None, net_type=None, __props__=None, __name__=None, __opts__=None)

Provides a PolarDB endpoint address resource to allocate an Internet endpoint address string for PolarDB instance.

NOTE: Available in v1.68.0+. Each PolarDB instance will allocate a intranet connection string automatically and its prefix is Cluster ID.

To avoid unnecessary conflict, please specified a internet connection prefix before applying the resource.

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
creation = config.get("creation")
if creation is None:
    creation = "PolarDB"
name = config.get("name")
if name is None:
    name = "polardbconnectionbasic"
default_zones = alicloud.get_zones(available_resource_creation=creation)
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    vpc_id=default_network.id,
    cidr_block="172.16.0.0/24",
    availability_zone=default_zones.zones[0]["id"])
default_cluster = alicloud.polardb.Cluster("defaultCluster",
    db_type="MySQL",
    db_version="8.0",
    pay_type="PostPaid",
    db_node_class="polar.mysql.x4.large",
    vswitch_id=default_switch.id,
    description=name)
default_endpoints = default_cluster.id.apply(lambda id: alicloud.polardb.get_endpoints(db_cluster_id=id))
endpoint = alicloud.polardb.EndpointAddress("endpoint",
    db_cluster_id=default_cluster.id,
    db_endpoint_id=default_endpoints.endpoints[0]["db_endpoint_id"],
    connection_prefix="testpolardbconn",
    net_type="Public")
Parameters
  • resource_name (str) – The name of the resource.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • connection_prefix (pulumi.Input[str]) – Prefix of an Internet connection string. It must be checked for uniqueness. It may consist of lowercase letters, numbers, and underlines, and must start with a letter and have no more than 30 characters. Default to + ‘tf’.

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster that can run database.

  • db_endpoint_id (pulumi.Input[str]) – The Id of endpoint that can run database.

  • net_type (pulumi.Input[str]) – Internet connection net type. Valid value: Public. Default to Public. Currently supported only Public.

connection_prefix: pulumi.Output[str] = None

Prefix of an Internet connection string. It must be checked for uniqueness. It may consist of lowercase letters, numbers, and underlines, and must start with a letter and have no more than 30 characters. Default to + ‘tf’.

connection_string: pulumi.Output[str] = None

Connection cluster or endpoint string.

db_cluster_id: pulumi.Output[str] = None

The Id of cluster that can run database.

db_endpoint_id: pulumi.Output[str] = None

The Id of endpoint that can run database.

ip_address: pulumi.Output[str] = None

The ip address of connection string.

net_type: pulumi.Output[str] = None

Internet connection net type. Valid value: Public. Default to Public. Currently supported only Public.

port: pulumi.Output[str] = None

Connection cluster or endpoint port.

static get(resource_name, id, opts=None, connection_prefix=None, connection_string=None, db_cluster_id=None, db_endpoint_id=None, ip_address=None, net_type=None, port=None)

Get an existing EndpointAddress resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • connection_prefix (pulumi.Input[str]) – Prefix of an Internet connection string. It must be checked for uniqueness. It may consist of lowercase letters, numbers, and underlines, and must start with a letter and have no more than 30 characters. Default to + ‘tf’.

  • connection_string (pulumi.Input[str]) – Connection cluster or endpoint string.

  • db_cluster_id (pulumi.Input[str]) – The Id of cluster that can run database.

  • db_endpoint_id (pulumi.Input[str]) – The Id of endpoint that can run database.

  • ip_address (pulumi.Input[str]) – The ip address of connection string.

  • net_type (pulumi.Input[str]) – Internet connection net type. Valid value: Public. Default to Public. Currently supported only Public.

  • port (pulumi.Input[str]) – Connection cluster or endpoint port.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters

prop (str) – A property name.

Returns

A potentially transformed property name.

Return type

str

class pulumi_alicloud.polardb.GetAccountsResult(accounts=None, db_cluster_id=None, id=None, name_regex=None, names=None)

A collection of values returned by getAccounts.

accounts = None

A list of PolarDB cluster accounts. Each element contains the following attributes:

id = None

The provider-assigned unique ID for this managed resource.

names = None

Account name of the cluster.

class pulumi_alicloud.polardb.GetClustersResult(clusters=None, db_type=None, description_regex=None, descriptions=None, id=None, ids=None, output_file=None, status=None, tags=None)

A collection of values returned by getClusters.

clusters = None

A list of PolarDB clusters. Each element contains the following attributes:

db_type = None

Primary for primary cluster, ReadOnly for read-only cluster, Guard for disaster recovery cluster, and Temp for temporary cluster.

descriptions = None

A list of RDS cluster descriptions.

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of RDS cluster IDs.

status = None

Status of the cluster.

class pulumi_alicloud.polardb.GetDatabasesResult(databases=None, db_cluster_id=None, id=None, name_regex=None, names=None)

A collection of values returned by getDatabases.

databases = None

A list of PolarDB cluster databases. Each element contains the following attributes:

id = None

The provider-assigned unique ID for this managed resource.

names = None

database name of the cluster.

class pulumi_alicloud.polardb.GetEndpointsResult(db_cluster_id=None, db_endpoint_id=None, endpoints=None, id=None)

A collection of values returned by getEndpoints.

db_endpoint_id = None

The endpoint ID.

endpoints = None

A list of PolarDB cluster endpoints. Each element contains the following attributes:

id = None

The provider-assigned unique ID for this managed resource.

class pulumi_alicloud.polardb.GetNodeClassesResult(classes=None, db_node_class=None, db_type=None, db_version=None, id=None, output_file=None, pay_type=None, region_id=None, zone_id=None)

A collection of values returned by getNodeClasses.

classes = None

A list of PolarDB node classes. Each element contains the following attributes:

db_node_class = None

PolarDB node available class.

id = None

The provider-assigned unique ID for this managed resource.

zone_id = None

The Zone to launch the PolarDB cluster.

class pulumi_alicloud.polardb.GetZonesResult(id=None, ids=None, multi=None, output_file=None, zones=None)

A collection of values returned by getZones.

id = None

The provider-assigned unique ID for this managed resource.

ids = None

A list of zone IDs.

zones = None

A list of availability zones. Each element contains the following attributes:

pulumi_alicloud.polardb.get_accounts(db_cluster_id=None, name_regex=None, opts=None)

The polardb.getAccounts data source provides a collection of PolarDB cluster database account available in Alibaba Cloud account. Filters support regular expression for the account name, searches by clusterId.

NOTE: Available in v1.70.0+.

import pulumi
import pulumi_alicloud as alicloud

polardb_clusters_ds = alicloud.polardb.get_clusters(description_regex="pc-\w+",
    status="Running")
default = alicloud.polardb.get_accounts(db_cluster_id=polardb_clusters_ds.clusters[0]["id"])
pulumi.export("ends", default.accounts[0]["account_name"])
Parameters
  • db_cluster_id (str) – The polarDB cluster ID.

  • name_regex (str) – A regex string to filter results by account name.

pulumi_alicloud.polardb.get_clusters(db_type=None, description_regex=None, ids=None, output_file=None, status=None, tags=None, opts=None)

The polardb.getClusters data source provides a collection of PolarDB clusters available in Alibaba Cloud account. Filters support regular expression for the cluster description, searches by tags, and other filters which are listed below.

NOTE: Available in v1.66.0+.

import pulumi
import pulumi_alicloud as alicloud

polardb_clusters_ds = alicloud.polardb.get_clusters(description_regex="pc-\w+",
    status="Running")
pulumi.export("firstPolardbClusterId", polardb_clusters_ds.clusters[0]["id"])
Parameters
  • db_type (str) – Database type. Options are MySQL, Oracle and PostgreSQL. If no value is specified, all types are returned.

  • description_regex (str) – A regex string to filter results by cluster description.

  • ids (list) – A list of PolarDB cluster IDs.

  • status (str) – status of the cluster.

  • tags (dict) – A mapping of tags to assign to the resource.

- Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
- Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
pulumi_alicloud.polardb.get_databases(db_cluster_id=None, name_regex=None, opts=None)

The polardb.getDatabases data source provides a collection of PolarDB cluster database available in Alibaba Cloud account. Filters support regular expression for the database name, searches by clusterId.

NOTE: Available in v1.70.0+.

import pulumi
import pulumi_alicloud as alicloud

polardb_clusters_ds = alicloud.polardb.get_clusters(description_regex="pc-\w+",
    status="Running")
default = alicloud.polardb.get_databases(db_cluster_id=polardb_clusters_ds.clusters[0]["id"])
pulumi.export("ends", default.databases[0]["db_name"])
Parameters
  • db_cluster_id (str) – The polarDB cluster ID.

  • name_regex (str) – A regex string to filter results by database name.

pulumi_alicloud.polardb.get_endpoints(db_cluster_id=None, db_endpoint_id=None, opts=None)

The polardb.getEndpoints data source provides a collection of PolarDB endpoints available in Alibaba Cloud account. Filters support regular expression for the cluster name, searches by clusterId, and other filters which are listed below.

NOTE: Available in v1.68.0+.

import pulumi
import pulumi_alicloud as alicloud

polardb_clusters_ds = alicloud.polardb.get_clusters(description_regex="pc-\w+",
    status="Running")
default = alicloud.polardb.get_endpoints(db_cluster_id=polardb_clusters_ds.clusters[0]["id"])
pulumi.export("ends", default.endpoints[0]["db_endpoint_id"])
Parameters
  • db_cluster_id (str) – PolarDB cluster ID.

  • db_endpoint_id (str) – endpoint of the cluster.

pulumi_alicloud.polardb.get_node_classes(db_node_class=None, db_type=None, db_version=None, output_file=None, pay_type=None, region_id=None, zone_id=None, opts=None)

This data source provides the PolarDB node classes resource available info of Alibaba Cloud.

NOTE: Available in v1.81.0+

import pulumi
import pulumi_alicloud as alicloud

resources_zones = alicloud.get_zones(available_resource_creation="PolarDB")
resources_node_classes = alicloud.polardb.get_node_classes(db_type="MySQL",
    db_version="5.6",
    pay_type="Postpaid",
    zone_id=resources_zones.zones[0]["id"])
pulumi.export("firstPolardbNodeClass", resources_node_classes.classes)
Parameters
  • db_node_class (str) – The PolarDB node class type by the user.

  • db_type (str) – Database type. Options are MySQL, PostgreSQL, Oracle. If db_type is set, db_version also needs to be set.

  • db_version (str) – Database version required by the user. Value options can refer to the latest docs detail info DBVersion. If db_version is set, db_type also needs to be set.

  • pay_type (str) – Filter the results by charge type. Valid values: PrePaid and PostPaid.

  • region_id (str) – The Region to launch the PolarDB cluster.

  • zone_id (str) – The Zone to launch the PolarDB cluster.

pulumi_alicloud.polardb.get_zones(multi=None, output_file=None, opts=None)

This data source provides availability zones for PolarDB that can be accessed by an Alibaba Cloud account within the region configured in the provider.

NOTE: Available in v1.74.0+.

import pulumi
import pulumi_alicloud as alicloud

zones_ids = alicloud.polardb.get_zones()
Parameters

multi (bool) – Indicate whether the zones can be used in a multi AZ configuration. Default to false. Multi AZ is usually used to launch PolarDB instances.