All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::REDIS::Instance

Last Updated:Sep 13, 2024

ALIYUN::REDIS::Instance is used to create a Tair (Redis OSS-compatible) instance.

Syntax

 {
  "Type": "ALIYUN::REDIS::Instance",
  "Properties": {
    "VpcId": String,
    "EvictionPolicy": String,
    "BackupPolicy": Map,
    "ZoneId": String,
    "InstanceClass": String,
    "InstanceMaintainTime": Map,
    "Tags": List,
    "VpcPasswordFree": Boolean,
    "VSwitchId": String,
    "SecurityGroupId": String,
    "EngineVersion": String,
    "SSLEnabled": String,
    "Password": String,
    "InstanceName": String,
    "DeletionForce": Boolean,
    "Connections": Map,
    "ChargeType": String,
    "Period": Integer,
    "AutoRenewDuration": Integer,
    "ProductType": String
    "SecondaryZoneId": String,
    "ResourceGroupId": String,
    "PeriodUnit": String,
    "TairConfig": Map,
    "ShardCount": Integer,
    "NodeType": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

EngineVersion

String

No

No

The version of the database engine.

Valid values:

  • 2.8

    Note

    This version is unavailable. Select another one.

  • 4.0

  • 5.0

InstanceClass

String

No

Yes

The instance specifications.

For more information, see Overview.

InstanceMaintainTime

Map

No

Yes

The maintenance window of the instance.

None.

Tags

List

No

Yes

The tags of the instance.

You can add up to 20 tags to an instance.

For more information, see Tags properties.

VpcPasswordFree

Boolean

No

No

Specifies whether to enable the password-free access feature for the instance in the virtual private cloud (VPC).

Valid values:

  • true

  • false (default)

VpcId

String

No

No

The VPC ID.

None.

EvictionPolicy

String

No

No

The data eviction policy.

Valid values:

  • noeviction: The system does not evict keys, but returns an error for write operations.

  • allkeys-lru: The system evicts least recently used (LRU) keys.

  • volatile-lru: The system evicts LRU keys from keys that have time to live (TTL) configured.

  • allkeys-random: The system evicts keys at random.

  • volatile-random: The system evicts keys at random from keys that have TTL configured.

  • volatile-ttl: The system evicts keys with the shortest TTL from keys that have TTL configured.

ZoneId

String

No

No

The zone ID of the instance.

You must specify this property when the instance is created in a VPC.

If you want to create the instance in multiple zones, call the DescribeZones operation to query the IDs of supported zones.

VSwitchId

String

No

No

The ID of the vSwitch that resides in the VPC.

None.

SecurityGroupId

String

No

Yes

The ID of the security group.

You can specify up to 10 IDs. Separate multiple IDs with commas (,).

Password

String

No

Yes

The password.

The password must be 8 to 30 characters in length and must contain uppercase letters, lowercase letters, and digits.

SSLEnabled

String

No

Yes

The status of Secure Sockets Layer (SSL) encryption.

Valid values:

  • Disable: SSL encryption is disabled.

  • Enable: SSL encryption is enabled.

  • Update: The SSL certificate is updated.

InstanceName

String

No

Yes

The instance name.

The name must be 2 to 128 characters in length and can contain letters, digits, underscores (_), hyphens (-), and periods (.). The name must start with a letter.

DeletionForce

Boolean

No

Yes

Specifies whether to delete the instance when the instance is moved to the recycle bin.

Valid values:

  • true

  • false (default)

Connections

Map

No

Yes

The endpoints of the instance.

For more information, see Connections properties.

BackupPolicy

Map

No

Yes

The backup policy.

For more information, see BackupPolicy properties.

ChargeType

String

No

No

The billing method of the instance.

Valid values:

  • PostPaid (default): pay-as-you-go

  • PrePaid: subscription

Period

Integer

No

No

The billing cycle of the instance.

Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, and 60.

Unit: month.

AutoRenewDuration

Integer

No

Yes

The auto-renewal duration of the instance.

Valid values: 1 to 12.

Unit: month.

When an instance is about to expire, the system automatically renews the instance based on the value of this property.

Note

This property takes effect when ChargeType is set to PrePaid.

ProductType

String

No

No

The instance edition.

Valid values:

  • Local: a Community Edition instance that supports local disks or a Tair performance-enhanced instance that supports local disks

  • Tair_rdb: a Tair performance-enhanced instance that supports cloud disks

  • Tair_scm: a Tair persistent memory-optimized instance

  • Tair_essd: a Tair storage-optimized instance

  • OnECS: a Community Edition instance that supports cloud disks

Note

We recommend that you specify ProductType to accelerate parameter queries.

SecondaryZoneId

String

No

No

The ID of the secondary zone.

You can call the DescribeZones operation to query the ID of the secondary zone.

Note

If you specify this property, the master node and replica node of the instance can be deployed in different zones, and disaster recovery is implemented across zones. The instance can withstand failures in data centers.

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

PeriodUnit

String

No

No

The unit of the subscription duration.

Valid values:

  • Year

  • Month

TairConfig

Map

No

No

The Tair configurations.

For more information, see TairConfig properties.

ShardCount

Integer

No

No

The number of shards.

This property is available only for cluster instances that use cloud disks. You can use this property to specify a custom number of data shards.

NodeType

String

No

No

The node type.

Valid values:

  • MASTER_SLAVE: high availability (master-replica)

  • STAND_ALONE: standalone

  • double: master-replica

  • single: standalone

Note

If you want to create a cloud-native instance, set this property to MASTER_SLAVE or STAND_ALONE. If you want to create a classic instance, set this property to double or single.

BackupPolicy syntax

"BackupPolicy": {
  "PreferredBackupPeriod": "String",
  "PreferredBackupTime": "String",
  "EnableBackupLog": "Integer"
}

BackupPolicy properties

Property

Type

Required

Editable

Description

Constraint

PreferredBackupPeriod

String

Yes

Yes

The day of a week on which the system backs up data.

Valid values:

  • Monday

  • Tuesday

  • Wednesday

  • Thursday

  • Friday

  • Saturday

  • Sunday

PreferredBackupTime

String

Yes

Yes

The time at which the system backs up data.

Specify the time in the ISO 8601 standard in the HH:mmZ-HH:mmZ format.

EnableBackupLog

Integer

No

Yes

Specifies whether to enable incremental backup.

Valid values:

  • 1: enables incremental backup.

  • 0 (default): disables incremental backup.

InstanceMaintainTime syntax

"InstanceMaintainTime": {
  "MaintainStartTime": "String",
  "MaintainEndTime": "String"
}

InstanceMaintainTime properties

Property

Type

Required

Editable

Description

Constraint

MaintainStartTime

String

No

No

The start time of the maintenance window.

Specify the time in the ISO 8601 standard in the HH:mmZ format. The time must be in UTC. For example, if you want the maintenance window to start at 01:00:00 (UTC+8), set this property to 17:00Z.

MaintainEndTime

String

No

No

The end time of the maintenance window.

Specify the time in the ISO 8601 standard in the HH:mmZ format. The time must be in UTC. For example, if you want the maintenance window to end at 02:00:00 (UTC+8), set this property to 18:00Z.

Note

The end time must be one hour later than the start time. For example, if you set MaintainStartTime to 17:00Z, set MaintainEndTime to 18:00Z.

Tags syntax

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]  

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

A tag key must be unique within an Alibaba Cloud account in a region.

Value

String

No

No

The tag value.

None.

Connections syntax

"Connections": {
  "VpcPrivateConnection": "Map",
  "ClassicInnerConnection": "Map",
  "DirectConnection": "Map",
  "PublicConnection": "Map"
}

Connections properties

Property

Type

Required

Editable

Description

Constraint

VpcPrivateConnection

Map

No

Yes

The VPC endpoint.

For more information, see VpcPrivateConnection properties.

ClassicInnerConnection

Map

No

Yes

The classic network endpoint.

For more information, see ClassicInnerConnection properties.

DirectConnection

Map

No

Yes

The private endpoint in direct connection mode. If your instance is a cluster instance, you can apply for a private endpoint in direct connection mode based on your business requirements.

For more information, see DirectConnection properties.

PublicConnection

Map

No

Yes

The public endpoint.

For more information, see PublicConnection properties.

VpcPrivateConnection syntax

"VpcPrivateConnection": {
  "ConnectionPort": Integer,
  "ConnectionString": String
}

VpcPrivateConnection properties

Property

Type

Required

Editable

Description

Constraint

ConnectionPort

Integer

Yes

Yes

The port number used by the instance to provide services.

Valid values: 1024 to 65535.

ConnectionString

String

Yes

Yes

The prefix of the VPC endpoint.

The prefix must be 8 to 64 characters in length and can contain lowercase letters and digits. The prefix must start with a lowercase letter.

PublicConnection syntax

"PublicConnection": {
  "ConnectionPort": Integer,
  "ConnectionString": String
}

PublicConnection properties

Property

Type

Required

Editable

Description

Constraint

ConnectionPort

Integer

Yes

Yes

The port number used by the instance to provide services.

Valid values: 1024 to 65535.

ConnectionString

String

Yes

Yes

The prefix of the public endpoint.

The prefix must be 8 to 64 characters in length and can contain lowercase letters and digits. The prefix must start with a lowercase letter.

DirectConnection syntax

"DirectConnection": {
  "ConnectionPort": Integer,
  "ConnectionString": String
}

DirectConnection properties

Property

Type

Required

Editable

Description

Constraint

ConnectionPort

Integer

Yes

Yes

The port number used by the instance to provide services.

Valid values: 1024 to 65535.

ConnectionString

String

Yes

Yes

The prefix of the private endpoint in direct connection mode.

The prefix must be 8 to 64 characters in length and can contain lowercase letters and digits. The prefix must start with a lowercase letter.

ClassicInnerConnection syntax

"ClassicInnerConnection": {
  "ConnectionPort": Integer,
  "ConnectionString": String
}

ClassicInnerConnection properties

Property

Type

Required

Editable

Description

Constraint

ConnectionPort

Integer

Yes

Yes

The port number used by the instance to provide services.

Valid values: 1024 to 65535.

ConnectionString

String

Yes

Yes

The prefix of the classic network endpoint.

The prefix must be 8 to 64 characters in length and can contain lowercase letters and digits. The prefix must start with a lowercase letter.

TairConfig syntax

"TairConfig": {
  "Storage": "Integer",
  "StorageType": "String",
  "ShardCount": "Integer"
}

TairConfig properties

Property

Type

Required

Editable

Description

Constraint

Storage

Integer

No

No

The storage capacity of the cloud disk.

The storage capacity varies based on the instance specification. For more information, see ESSD/SSD-based instances.

StorageType

String

No

No

The storage type of the instance.

Valid values:

  • essd_pl0

  • essd_pl1

  • essd_pl2

  • essd_pl3

ShardCount

Integer

No

No

The number of data shards on the instance.

Valid values:

  • 1 (default): The instance uses the standard architecture that contains only a single data shard.

  • 2 to 32: The instance uses the cluster architecture that contains a specified number of data shards.

Return values

Fn::GetAtt

  • InstanceId: the instance ID.

  • OrderId: the order ID of the instance.

  • ConnectionDomain: the private endpoint that is used to access the instance.

  • Port: the port number used by the instance to provide services.

  • InstanceName: the instance name.

  • InstanceClass: the instance specifications.

  • VpcId: the VPC ID of the instance.

  • Capacity: the storage capacity of the instance.

  • InstanceType: the type of the database engine.

  • ChargeType: the billing method of the instance.

  • PackageType: the plan type of the instance.

  • Connections: the maximum number of connections that are supported by the instance.

  • ArchitectureType: the architecture type of the instance.

  • NodeType: the node type of the instance.

  • HasRenewChangeOrder: indicates whether the instance has pending renewal or resource scale-out orders within the current Alibaba Cloud account.

  • ResourceGroupId: the ID of the resource group.

  • QPS: the queries per second (QPS) of the instance. The value is the expected maximum QPS.

  • ZoneId: the zone ID of the instance.

  • Bandwidth: the bandwidth of the instance. Unit: Mbit/s.

  • EngineVersion: the version of the database engine.

  • NetworkType: the network type of the instance.

  • VSwitchId: the vSwitch ID of the instance.

  • PrivateIp: the private IP address of the instance.

  • PublicConnectionString: the prefix of the public endpoint that is used to access the instance.

  • VpcPrivateConnectionPort: the port number that is used to access the instance by using the VPC endpoint.

  • ClassicInnerConnectionString: the prefix of the classic network endpoint that is used to access the instance.

  • VpcPrivateConnectionString: the prefix of the VPC endpoint that is used to access the instance.

  • PublicConnectionPort: the port number that is used to access the instance by using the public endpoint.

  • DirectConnectionString: the prefix of the private endpoint that is used to access the instance in direct connection mode.

  • DirectConnectionPort: the port number that is used to access the instance by using the private endpoint in direct connection mode.

  • ClassicInnerConnectionPort: the port number that is used to access the instance by using the classic network endpoint.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Description: {}
Parameters:
  VpcId:
    Type: String
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
  ZoneId:
    Type: String
    Description:
       
      en: Before you create an instance, confirm that the Availability Zone supports the specifications of Redis resources.
    AssociationProperty: ALIYUN::ECS::Instance:ZoneId
    Label:
      en: Zone ID
       
  VSwitchId:
    Type: String
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
      ZoneId: ${ZoneId}
Resources:
  RedisInstance:
    Type: ALIYUN::REDIS::Instance
    Properties:
      VpcId:
        Ref: VpcId
      VSwitchId:
        Ref: VSwitchId
      InstanceClass: redis.master.small.default
      EvictionPolicy: noeviction
      ZoneId:
        Ref: ZoneId
      InstanceName: DefaultRedis
      Password: Admin@123!
Outputs:
  InstanceId:
    Value:
      Fn::GetAtt:
        - RedisInstance
        - InstanceId                     

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
  },
  "Parameters": {
    "VpcId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
    },
    "ZoneId": {
      "Type": "String",
      "Description": {
         
        "en": "Before you create an instance, confirm that the Availability Zone supports the specifications of Redis resources."
      },
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
      "Label": {
        "en": "Zone ID",
         
      }
    },
    "VSwitchId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}",
        "ZoneId": "${ZoneId}"
      }
    }
  },
  "Resources": {
    "RedisInstance": {
      "Type": "ALIYUN::REDIS::Instance",
      "Properties": {
        "VpcId": {
          "Ref": "VpcId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "InstanceClass": "redis.master.small.default",
        "EvictionPolicy": "noeviction",
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "InstanceName": "DefaultRedis",
        "Password": "Admin@123!"
      }
    }
  },
  "Outputs": {
    "InstanceId": {
      "Value": {
        "Fn::GetAtt": [
          "RedisInstance",
          "InstanceId"
        ]
      }
    }
  }
}

For more examples, visit Instance.yml. In the examples, the following resource types are used: ALIYUN::REDIS::Instance, ALIYUN::REDIS::Whitelist, and ALIYUN::REDIS::Account.