Show / Hide Table of Contents

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,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
ReadOnlyInstance
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.AliCloud.Rds
Assembly: Pulumi.AliCloud.dll
Syntax
public class ReadOnlyInstance : CustomResource

Constructors

View Source

ReadOnlyInstance(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 Source

ConnectionString

RDS database connection string.

Declaration
public Output<string> ConnectionString { get; }
Property Value
Type Description
Output<System.String>
View Source

Engine

Database type.

Declaration
public Output<string> Engine { get; }
Property Value
Type Description
Output<System.String>
View Source

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>
View Source

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>
View Source

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>
View Source

InstanceType

DB Instance type. For details, see Instance type table.

Declaration
public Output<string> InstanceType { get; }
Property Value
Type Description
Output<System.String>
View Source

MasterDbInstanceId

ID of the master instance.

Declaration
public Output<string> MasterDbInstanceId { get; }
Property Value
Type Description
Output<System.String>
View Source

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>>
View Source

Port

RDS database connection port.

Declaration
public Output<string> Port { get; }
Property Value
Type Description
Output<System.String>
View Source

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>>
View Source

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>
View Source

ZoneId

The Zone to launch the DB instance.

Declaration
public Output<string> ZoneId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(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
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.