Provides a Polar Db Database resource.
Manage linked databases.
For information about Polar Db Database and how to use it, see What is Database.
NOTE: Available since v1.66.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = alicloud.polardb.getNodeClasses({
dbType: "MySQL",
dbVersion: "8.0",
payType: "PostPaid",
category: "Normal",
});
const defaultNetwork = new alicloud.vpc.Network("default", {
vpcName: "terraform-example",
cidrBlock: "172.16.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
vpcId: defaultNetwork.id,
cidrBlock: "172.16.0.0/24",
zoneId: _default.then(_default => _default.classes?.[0]?.zoneId),
vswitchName: "terraform-example",
});
const defaultCluster = new alicloud.polardb.Cluster("default", {
dbType: "MySQL",
dbVersion: "8.0",
dbNodeClass: _default.then(_default => _default.classes?.[0]?.supportedEngines?.[0]?.availableResources?.[0]?.dbNodeClass),
payType: "PostPaid",
vswitchId: defaultSwitch.id,
description: "terraform-example",
});
const defaultDatabase = new alicloud.polardb.Database("default", {
dbClusterId: defaultCluster.id,
dbName: "terraform-example",
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.polardb.get_node_classes(db_type="MySQL",
db_version="8.0",
pay_type="PostPaid",
category="Normal")
default_network = alicloud.vpc.Network("default",
vpc_name="terraform-example",
cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("default",
vpc_id=default_network.id,
cidr_block="172.16.0.0/24",
zone_id=default.classes[0].zone_id,
vswitch_name="terraform-example")
default_cluster = alicloud.polardb.Cluster("default",
db_type="MySQL",
db_version="8.0",
db_node_class=default.classes[0].supported_engines[0].available_resources[0].db_node_class,
pay_type="PostPaid",
vswitch_id=default_switch.id,
description="terraform-example")
default_database = alicloud.polardb.Database("default",
db_cluster_id=default_cluster.id,
db_name="terraform-example")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/polardb"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := polardb.GetNodeClasses(ctx, &polardb.GetNodeClassesArgs{
DbType: pulumi.StringRef("MySQL"),
DbVersion: pulumi.StringRef("8.0"),
PayType: "PostPaid",
Category: pulumi.StringRef("Normal"),
}, nil)
if err != nil {
return err
}
defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
VpcName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.16.0.0/16"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VpcId: defaultNetwork.ID(),
CidrBlock: pulumi.String("172.16.0.0/24"),
ZoneId: pulumi.String(_default.Classes[0].ZoneId),
VswitchName: pulumi.String("terraform-example"),
})
if err != nil {
return err
}
defaultCluster, err := polardb.NewCluster(ctx, "default", &polardb.ClusterArgs{
DbType: pulumi.String("MySQL"),
DbVersion: pulumi.String("8.0"),
DbNodeClass: pulumi.String(_default.Classes[0].SupportedEngines[0].AvailableResources[0].DbNodeClass),
PayType: pulumi.String("PostPaid"),
VswitchId: defaultSwitch.ID(),
Description: pulumi.String("terraform-example"),
})
if err != nil {
return err
}
_, err = polardb.NewDatabase(ctx, "default", &polardb.DatabaseArgs{
DbClusterId: defaultCluster.ID(),
DbName: pulumi.String("terraform-example"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.PolarDB.GetNodeClasses.Invoke(new()
{
DbType = "MySQL",
DbVersion = "8.0",
PayType = "PostPaid",
Category = "Normal",
});
var defaultNetwork = new AliCloud.Vpc.Network("default", new()
{
VpcName = "terraform-example",
CidrBlock = "172.16.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
VpcId = defaultNetwork.Id,
CidrBlock = "172.16.0.0/24",
ZoneId = @default.Apply(@default => @default.Apply(getNodeClassesResult => getNodeClassesResult.Classes[0]?.ZoneId)),
VswitchName = "terraform-example",
});
var defaultCluster = new AliCloud.PolarDB.Cluster("default", new()
{
DbType = "MySQL",
DbVersion = "8.0",
DbNodeClass = @default.Apply(@default => @default.Apply(getNodeClassesResult => getNodeClassesResult.Classes[0]?.SupportedEngines[0]?.AvailableResources[0]?.DbNodeClass)),
PayType = "PostPaid",
VswitchId = defaultSwitch.Id,
Description = "terraform-example",
});
var defaultDatabase = new AliCloud.PolarDB.Database("default", new()
{
DbClusterId = defaultCluster.Id,
DbName = "terraform-example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.polardb.PolardbFunctions;
import com.pulumi.alicloud.polardb.inputs.GetNodeClassesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.polardb.Cluster;
import com.pulumi.alicloud.polardb.ClusterArgs;
import com.pulumi.alicloud.polardb.Database;
import com.pulumi.alicloud.polardb.DatabaseArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var default = PolardbFunctions.getNodeClasses(GetNodeClassesArgs.builder()
.dbType("MySQL")
.dbVersion("8.0")
.payType("PostPaid")
.category("Normal")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.16.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vpcId(defaultNetwork.id())
.cidrBlock("172.16.0.0/24")
.zoneId(default_.classes()[0].zoneId())
.vswitchName("terraform-example")
.build());
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.dbType("MySQL")
.dbVersion("8.0")
.dbNodeClass(default_.classes()[0].supportedEngines()[0].availableResources()[0].dbNodeClass())
.payType("PostPaid")
.vswitchId(defaultSwitch.id())
.description("terraform-example")
.build());
var defaultDatabase = new Database("defaultDatabase", DatabaseArgs.builder()
.dbClusterId(defaultCluster.id())
.dbName("terraform-example")
.build());
}
}
resources:
defaultNetwork:
type: alicloud:vpc:Network
name: default
properties:
vpcName: terraform-example
cidrBlock: 172.16.0.0/16
defaultSwitch:
type: alicloud:vpc:Switch
name: default
properties:
vpcId: ${defaultNetwork.id}
cidrBlock: 172.16.0.0/24
zoneId: ${default.classes[0].zoneId}
vswitchName: terraform-example
defaultCluster:
type: alicloud:polardb:Cluster
name: default
properties:
dbType: MySQL
dbVersion: '8.0'
dbNodeClass: ${default.classes[0].supportedEngines[0].availableResources[0].dbNodeClass}
payType: PostPaid
vswitchId: ${defaultSwitch.id}
description: terraform-example
defaultDatabase:
type: alicloud:polardb:Database
name: default
properties:
dbClusterId: ${defaultCluster.id}
dbName: terraform-example
variables:
default:
fn::invoke:
function: alicloud:polardb:getNodeClasses
arguments:
dbType: MySQL
dbVersion: '8.0'
payType: PostPaid
category: Normal
📚 Need more examples? VIEW MORE EXAMPLES
Create Database Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Database(name: string, args: DatabaseArgs, opts?: CustomResourceOptions);@overload
def Database(resource_name: str,
args: DatabaseArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Database(resource_name: str,
opts: Optional[ResourceOptions] = None,
db_cluster_id: Optional[str] = None,
db_name: Optional[str] = None,
account_name: Optional[str] = None,
character_set_name: Optional[str] = None,
collate: Optional[str] = None,
ctype: Optional[str] = None,
db_description: Optional[str] = None)func NewDatabase(ctx *Context, name string, args DatabaseArgs, opts ...ResourceOption) (*Database, error)public Database(string name, DatabaseArgs args, CustomResourceOptions? opts = null)
public Database(String name, DatabaseArgs args)
public Database(String name, DatabaseArgs args, CustomResourceOptions options)
type: alicloud:polardb:Database
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var alicloudDatabaseResource = new AliCloud.PolarDB.Database("alicloudDatabaseResource", new()
{
DbClusterId = "string",
DbName = "string",
AccountName = "string",
CharacterSetName = "string",
Collate = "string",
Ctype = "string",
DbDescription = "string",
});
example, err := polardb.NewDatabase(ctx, "alicloudDatabaseResource", &polardb.DatabaseArgs{
DbClusterId: pulumi.String("string"),
DbName: pulumi.String("string"),
AccountName: pulumi.String("string"),
CharacterSetName: pulumi.String("string"),
Collate: pulumi.String("string"),
Ctype: pulumi.String("string"),
DbDescription: pulumi.String("string"),
})
var alicloudDatabaseResource = new com.pulumi.alicloud.polardb.Database("alicloudDatabaseResource", com.pulumi.alicloud.polardb.DatabaseArgs.builder()
.dbClusterId("string")
.dbName("string")
.accountName("string")
.characterSetName("string")
.collate("string")
.ctype("string")
.dbDescription("string")
.build());
alicloud_database_resource = alicloud.polardb.Database("alicloudDatabaseResource",
db_cluster_id="string",
db_name="string",
account_name="string",
character_set_name="string",
collate="string",
ctype="string",
db_description="string")
const alicloudDatabaseResource = new alicloud.polardb.Database("alicloudDatabaseResource", {
dbClusterId: "string",
dbName: "string",
accountName: "string",
characterSetName: "string",
collate: "string",
ctype: "string",
dbDescription: "string",
});
type: alicloud:polardb:Database
properties:
accountName: string
characterSetName: string
collate: string
ctype: string
dbClusterId: string
dbDescription: string
dbName: string
Database Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Database resource accepts the following input properties:
- Db
Cluster stringId - The ID of cluster.
- Db
Name string - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- Account
Name string - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - Character
Set stringName - The character set that is used by the cluster. For more information, see Character set tables.
- Collate string
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- Ctype string
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- Db
Description string - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- Db
Cluster stringId - The ID of cluster.
- Db
Name string - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- Account
Name string - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - Character
Set stringName - The character set that is used by the cluster. For more information, see Character set tables.
- Collate string
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- Ctype string
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- Db
Description string - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- db
Cluster StringId - The ID of cluster.
- db
Name String - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- account
Name String - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - character
Set StringName - The character set that is used by the cluster. For more information, see Character set tables.
- collate String
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- ctype String
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- db
Description String - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- db
Cluster stringId - The ID of cluster.
- db
Name string - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- account
Name string - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - character
Set stringName - The character set that is used by the cluster. For more information, see Character set tables.
- collate string
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- ctype string
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- db
Description string - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- db_
cluster_ strid - The ID of cluster.
- db_
name str - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- account_
name str - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - character_
set_ strname - The character set that is used by the cluster. For more information, see Character set tables.
- collate str
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- ctype str
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- db_
description str - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- db
Cluster StringId - The ID of cluster.
- db
Name String - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- account
Name String - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - character
Set StringName - The character set that is used by the cluster. For more information, see Character set tables.
- collate String
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- ctype String
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- db
Description String - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
Outputs
All input properties are implicitly available as output properties. Additionally, the Database resource produces the following output properties:
Look up Existing Database Resource
Get an existing Database resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DatabaseState, opts?: CustomResourceOptions): Database@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_name: Optional[str] = None,
character_set_name: Optional[str] = None,
collate: Optional[str] = None,
ctype: Optional[str] = None,
db_cluster_id: Optional[str] = None,
db_description: Optional[str] = None,
db_name: Optional[str] = None,
status: Optional[str] = None) -> Databasefunc GetDatabase(ctx *Context, name string, id IDInput, state *DatabaseState, opts ...ResourceOption) (*Database, error)public static Database Get(string name, Input<string> id, DatabaseState? state, CustomResourceOptions? opts = null)public static Database get(String name, Output<String> id, DatabaseState state, CustomResourceOptions options)resources: _: type: alicloud:polardb:Database get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Account
Name string - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - Character
Set stringName - The character set that is used by the cluster. For more information, see Character set tables.
- Collate string
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- Ctype string
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- Db
Cluster stringId - The ID of cluster.
- Db
Description string - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- Db
Name string - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- Status string
- (Available since v1.265.0) The state of the database.
- Account
Name string - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - Character
Set stringName - The character set that is used by the cluster. For more information, see Character set tables.
- Collate string
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- Ctype string
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- Db
Cluster stringId - The ID of cluster.
- Db
Description string - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- Db
Name string - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- Status string
- (Available since v1.265.0) The state of the database.
- account
Name String - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - character
Set StringName - The character set that is used by the cluster. For more information, see Character set tables.
- collate String
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- ctype String
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- db
Cluster StringId - The ID of cluster.
- db
Description String - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- db
Name String - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- status String
- (Available since v1.265.0) The state of the database.
- account
Name string - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - character
Set stringName - The character set that is used by the cluster. For more information, see Character set tables.
- collate string
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- ctype string
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- db
Cluster stringId - The ID of cluster.
- db
Description string - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- db
Name string - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- status string
- (Available since v1.265.0) The state of the database.
- account_
name str - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - character_
set_ strname - The character set that is used by the cluster. For more information, see Character set tables.
- collate str
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- ctype str
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- db_
cluster_ strid - The ID of cluster.
- db_
description str - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- db_
name str - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- status str
- (Available since v1.265.0) The state of the database.
- account
Name String - The name of the account that is authorized to access the database. NOTE: From version 1.265.0,
account_namecan be modified. However, only PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL cluster can be modified. - character
Set StringName - The character set that is used by the cluster. For more information, see Character set tables.
- collate String
The language that defines the collation rules in the database.
NOTE: The locale must be compatible with the character set set set by
character_set_name. This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- ctype String
The language that indicates the character type of the database.
NOTE: The language must be compatible with the character set that is specified by
character_set_name. The value that you specify must be the same as the value ofcollate. This parameter is required for PolarDB for PostgreSQL (Compatible with Oracle) clusters or PolarDB for PostgreSQL clusters. This parameter is optional for PolarDB for MySQL clusters.This parameter is required for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster. This parameter is optional for a PolarDB for MySQL cluster.- db
Cluster StringId - The ID of cluster.
- db
Description String - The description of the database. The description must meet the following requirements:
- It cannot start with
http://orhttps://. - It must be 2 to 256 characters in length.
- It cannot start with
- db
Name String - The name of the database. It may consist of lower case letters, numbers, and underlines, and must start with a letterand have no more than 64 characters.
- status String
- (Available since v1.265.0) The state of the database.
Import
Polar Db Database can be imported using the id, e.g.
$ pulumi import alicloud:polardb/database:Database example <db_cluster_id>:<db_name>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
