Show / Hide Table of Contents

Class Instance

Provides an ApsaraDB Redis / Memcache instance resource. A DB instance is an isolated database environment in the cloud. It can be associated with IP whitelists and backup configuration which are separate resource providers.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
public MyStack()
{
    var config = new Config();
    var creation = config.Get("creation") ?? "KVStore";
    var name = config.Get("name") ?? "kvstoreinstancevpc";
    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.KVStore.Instance("defaultInstance", new AliCloud.KVStore.InstanceArgs
    {
        EngineVersion = "4.0",
        InstanceClass = "redis.master.small.default",
        InstanceName = name,
        InstanceType = "Redis",
        PrivateIp = "172.16.0.10",
        SecurityIps = 
        {
            "10.0.0.1",
        },
        VswitchId = defaultSwitch.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Instance
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.KVStore
Assembly: Pulumi.AliCloud.dll
Syntax
public class Instance : CustomResource

Constructors

View Source

Instance(String, InstanceArgs, CustomResourceOptions)

Create a Instance resource with the given unique name, arguments, and options.

Declaration
public Instance(string name, InstanceArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

InstanceArgs 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

AutoRenew

Whether to renewal a DB instance automatically or not. It is valid when instance_charge_type is PrePaid. Default to false.

Declaration
public Output<bool?> AutoRenew { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

AutoRenewPeriod

Auto-renewal period of an instance, in the unit of the month. It is valid when instance_charge_type is PrePaid. Valid value:[1~12], Default to 1.

Declaration
public Output<int?> AutoRenewPeriod { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

AvailabilityZone

The Zone to launch the DB instance.

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

BackupId

If an instance created based on a backup set generated by another instance is valid, this parameter indicates the ID of the generated backup set.

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

ConnectionDomain

Instance connection domain (only Intranet access supported).

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

EngineVersion

Engine version. Supported values: 2.8, 4.0 and 5.0. Default value: 2.8. Only 2.8 can be supported for Memcache Instance.

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

InstanceChargeType

Valid values are PrePaid, PostPaid, Default to PostPaid.

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

InstanceClass

Declaration
public Output<string> InstanceClass { 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

InstanceType

The engine to use: Redis or Memcache. Defaults to Redis.

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

KmsEncryptedPassword

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

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

KmsEncryptionContext

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

Declaration
public Output<ImmutableDictionary<string, object>> KmsEncryptionContext { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

MaintainEndTime

The end time of the operation and maintenance time period of the instance, in the format of HH:mmZ (UTC time).

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

MaintainStartTime

The start time of the operation and maintenance time period of the instance, in the format of HH:mmZ (UTC time).

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

Parameters

Set of parameters needs to be set after instance was launched. Available parameters can refer to the latest docs Instance configurations table .

Declaration
public Output<ImmutableArray<InstanceParameter>> Parameters { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<InstanceParameter>>
View Source

Password

The password of the DB instance. The password is a string of 8 to 30 characters and must contain uppercase letters, lowercase letters, and numbers.

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

Period

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

Declaration
public Output<int?> Period { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

PrivateIp

Set the instance's private IP.

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

SecurityGroupId

The Security Group ID of ECS.

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

SecurityIps

Set the instance's IP whitelist of the default security group.

Declaration
public Output<ImmutableArray<string>> SecurityIps { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Tags

A mapping of tags to assign to the resource.

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

VpcAuthMode

Only meaningful if instance_type is Redis and network type is VPC. Valid values are Close, Open. Defaults to Open. Close means the redis instance can be accessed without authentication. Open means authentication is required.

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

VswitchId

The ID of VSwitch.

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

Methods

View Source

Get(String, Input<String>, InstanceState, CustomResourceOptions)

Get an existing Instance resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Instance Get(string name, Input<string> id, InstanceState 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.

InstanceState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Instance
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.