Class Database
Provides an RDS database resource. A DB database deployed in a DB instance. A DB instance can own multiple databases.
NOTE: This resource does not support creating 'PPAS' database. You have to login RDS instance to create manually.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var creation = config.Get("creation") ?? "Rds";
var name = config.Get("name") ?? "dbdatabasebasic";
var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
{
AvailableResourceCreation = creation,
}));
var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
{
CidrBlock = "172.16.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
{
AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
CidrBlock = "172.16.0.0/24",
VpcId = defaultNetwork.Id,
});
var instance = new AliCloud.Rds.Instance("instance", new AliCloud.Rds.InstanceArgs
{
Engine = "MySQL",
EngineVersion = "5.6",
InstanceName = name,
InstanceStorage = "10",
InstanceType = "rds.mysql.s1.small",
VswitchId = defaultSwitch.Id,
});
var defaultDatabase = new AliCloud.Rds.Database("defaultDatabase", new AliCloud.Rds.DatabaseArgs
{
InstanceId = instance.Id,
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Rds
Assembly: Pulumi.AliCloud.dll
Syntax
public class Database : CustomResource
Constructors
View SourceDatabase(String, DatabaseArgs, CustomResourceOptions)
Create a Database resource with the given unique name, arguments, and options.
Declaration
public Database(string name, DatabaseArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| DatabaseArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCharacterSet
Character set. The value range is limited to the following:
- MySQL: [ utf8, gbk, latin1, utf8mb4 ] (
utf8mb4only supports versions 5.5 and 5.6). - SQLServer: [ Chinese_PRC_CI_AS, Chinese_PRC_CS_AS, SQL_Latin1_General_CP1_CI_AS, SQL_Latin1_General_CP1_CS_AS, Chinese_PRC_BIN ]
- PostgreSQL: [ KOI8U、UTF8、WIN866、WIN874、WIN1250、WIN1251、WIN1252、WIN1253、WIN1254、WIN1255、WIN1256、WIN1257、WIN1258、EUC_CN、EUC_KR、EUC_TW、EUC_JP、EUC_JIS_2004、KOI8R、MULE_INTERNAL、LATIN1、LATIN2、LATIN3、LATIN4、LATIN5、LATIN6、LATIN7、LATIN8、LATIN9、LATIN10、ISO_8859_5、ISO_8859_6、ISO_8859_7、ISO_8859_8、SQL_ASCII ]
Declaration
public Output<string> CharacterSet { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
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.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InstanceId
The Id of instance that can run database.
Declaration
public Output<string> InstanceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Name of the database 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 64 characters.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, DatabaseState, CustomResourceOptions)
Get an existing Database resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Database Get(string name, Input<string> id, DatabaseState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| DatabaseState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Database |