Class ReadOnlyInstance
Provides an RDS readonly instance resource.
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") ?? "dbInstancevpc";
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 defaultInstance = new AliCloud.Rds.Instance("defaultInstance", new AliCloud.Rds.InstanceArgs
{
Engine = "MySQL",
EngineVersion = "5.6",
InstanceChargeType = "Postpaid",
InstanceName = name,
InstanceStorage = "20",
InstanceType = "rds.mysql.t1.small",
SecurityIps =
{
"10.168.1.12",
"100.69.7.112",
},
VswitchId = defaultSwitch.Id,
});
var defaultReadOnlyInstance = new AliCloud.Rds.ReadOnlyInstance("defaultReadOnlyInstance", new AliCloud.Rds.ReadOnlyInstanceArgs
{
EngineVersion = defaultInstance.EngineVersion,
InstanceName = $"{name}ro",
InstanceStorage = "30",
InstanceType = defaultInstance.InstanceType,
MasterDbInstanceId = defaultInstance.Id,
VswitchId = defaultSwitch.Id,
ZoneId = defaultInstance.ZoneId,
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.Rds
Assembly: Pulumi.AliCloud.dll
Syntax
public class ReadOnlyInstance : CustomResource
Constructors
View SourceReadOnlyInstance(String, ReadOnlyInstanceArgs, CustomResourceOptions)
Create a ReadOnlyInstance resource with the given unique name, arguments, and options.
Declaration
public ReadOnlyInstance(string name, ReadOnlyInstanceArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ReadOnlyInstanceArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceConnectionString
RDS database connection string.
Declaration
public Output<string> ConnectionString { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Engine
Database type.
Declaration
public Output<string> Engine { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
EngineVersion
Database version. Value options can refer to the latest docs CreateDBInstance EngineVersion.
Declaration
public Output<string> EngineVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InstanceName
The name of DB instance. It a string of 2 to 256 characters.
Declaration
public Output<string> InstanceName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InstanceStorage
User-defined DB instance storage space. Value range: [5, 2000] for MySQL/SQL Server HA dual node edition. Increase progressively at a rate of 5 GB. For details, see Instance type table.
Declaration
public Output<int> InstanceStorage { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
InstanceType
DB Instance type. For details, see Instance type table.
Declaration
public Output<string> InstanceType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MasterDbInstanceId
ID of the master instance.
Declaration
public Output<string> MasterDbInstanceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Parameters
Set of parameters needs to be set after DB instance was launched. Available parameters can refer to the latest docs View database parameter templates.
Declaration
public Output<ImmutableArray<ReadOnlyInstanceParameter>> Parameters { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<ReadOnlyInstanceParameter>> |
Port
RDS database connection port.
Declaration
public Output<string> Port { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
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.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
VswitchId
The virtual switch ID to launch DB instances in one VPC.
Declaration
public Output<string> VswitchId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ZoneId
The Zone to launch the DB instance.
Declaration
public Output<string> ZoneId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, ReadOnlyInstanceState, CustomResourceOptions)
Get an existing ReadOnlyInstance resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ReadOnlyInstance Get(string name, Input<string> id, ReadOnlyInstanceState 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. |
| ReadOnlyInstanceState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ReadOnlyInstance |