ALIYUN::REDIS::Instance is used to create an ApsaraDB for Redis 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
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
EngineVersionStringNoNoThe version of the database engine. Valid values:
  • 2.8
    Note This version is unavailable. Select another one.
  • 4.0
  • 5.0
InstanceClass String No YesThe specifications of the instance. For more information, see Overview.
InstanceMaintainTimeMapNoYesThe maintenance window of the instance. None.
TagsListNoNoThe tags of the instance. You can add up to 20 tags to each instance.

For more information, see Tags properties.

VpcPasswordFreeBooleanNo No Specifies whether to enable the password-free authentication feature when you access the instance in the virtual private cloud (VPC). Default value: false. Valid values:
  • true
  • false
VpcId String No NoThe ID of the VPC in which the instance resides. None.
EvictionPolicy String No NoThe data eviction policy. Valid values:
  • noeviction: The system does not evict any of the keys, but returns an error for write operations.
  • allkeys-lru: The system evicts the least recently used (LRU) keys.
  • volatile-lru: The system evicts the LRU keys among keys for which time-to-live (TTL) values are configured.
  • allkeys-random: The system randomly evicts keys.
  • volatile-random: The system randomly evicts keys among the keys for which TTL values are configured.
  • volatile-ttl: The system evicts keys with the minimum TTL among keys for which TTL values are configured.
ZoneId String No NoThe ID of the zone in which the instance resides. This property is required if the instance is created in a VPC.

When you create a multi-zone instance, you can call the DescribeZones operation to query the IDs of zones in which you can create the instance.

VSwitchId String No NoThe ID of the vSwitch in the VPC. None.
SecurityGroupIdStringNoYesThe ID of the security group to which the instance belongs. You can specify up to 10 security group IDs. Separate multiple security group IDs with commas (,).
Password String No NoThe password that is used to access the instance. The password must be 8 to 30 characters in length, and must contain uppercase letters, lowercase letters, and digits.
SSLEnabledStringNoYesThe status of Secure Sockets Layer (SSL) encryption. Valid values:
  • Disable: disables SSL encryption.
  • Enable: enables SSL encryption.
  • Update: updates SSL certificates.
InstanceName String No YesThe name of the instance. 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.
DeletionForceBooleanNoYesSpecifies whether to delete the instance when the instance is reclaimed. Default value: false. Valid values:
  • true
  • false
ConnectionsMapNoYesThe endpoints of the instance. For more information, see Connections properties.
BackupPolicyMapNoYesThe backup policy. For more information, see BackupPolicy properties.
ChargeTypeStringNoNoThe billing method of the instance. Default value: PostPaid. Valid values:
  • PostPaid: pay-as-you-go
  • PrePaid: subscription
PeriodIntegerNoNoThe billing cycle of the instance. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, and 60.

Unit: months.

AutoRenewDurationIntegerNoYesThe auto-renewal period. Valid values: 1 to 12.

Unit: months.

When the instance is about to expire, the system enables auto-renewal based on the period that is specified by this property.

Note This property takes effect if you set the ChargeType property to PrePaid.
ProductTypeStringNoNoThe edition or series of the instance. Valid values:
  • Local: a Community Edition instance that supports local disks or an Enhanced Edition (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
SecondaryZoneIdStringNoNoThe ID of the secondary zone. You can call the DescribeZones operation to query the zone ID.
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.
ResourceGroupIdStringNoYesThe ID of the resource group. None.
PeriodUnitStringNoNoThe unit of the billing cycle. Valid values:
  • Year
  • Month

BackupPolicy syntax

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

BackupPolicy properties

PropertyTypeRequiredEditableDescriptionConstraint
PreferredBackupPeriodStringYesYesThe days on which backups are performed. Valid values:
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
PreferredBackupTimeStringYesYesThe backup window. Specify the window in the HH:mmZ-HH:mmZ format.
EnableBackupLogIntegerNoYesSpecifies whether to enable incremental backup. Default value: 0. Valid values:
  • 1: enables incremental backup.
  • 0: disables incremental backup.

InstanceMaintainTime syntax

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

InstanceMaintainTime properties

PropertyTypeRequiredEditableDescriptionConstraint
MaintainStartTimeStringNoNoThe start time of the maintenance window. Specify the time in the HH:mmZ format. The time must be in UTC. For example, if you want the maintenance window to start at 01:00 (UTC+8), set this property to 17:00Z.
MaintainEndTimeStringNoNoThe end time of the maintenance window. Specify the time in the HH:mmZ format. The time must be in UTC. For example, if you want the maintenance window to end at 02: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 the MaintainStartTime property is set to 17:00Z, the MaintainEndTime property must be set to 18:00Z.

Tags syntax

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

Tags properties

PropertyTypeRequiredEditableDescriptionConstraint
KeyStringYesNoThe key of the tag. Each tag key must be unique within an Alibaba Cloud account in a region.
ValueStringNoNoThe value of the tag. None.

Connections syntax

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

Connections properties

PropertyTypeRequiredEditableDescriptionConstraint
VpcPrivateConnectionMapNoYesThe VPC endpoint. For more information, see VpcPrivateConnection properties.
ClassicInnerConnectionMapNoYesThe classic network endpoint. For more information, see ClassicInnerConnection properties.
DirectConnectionMapNoYesThe private endpoint. If your instance is a cluster instance, you can request a private endpoint based on your business requirements. For more information, see DirectConnection properties.
PublicConnectionMapNoYesThe public endpoint. For more information, see PublicConnection properties.

VpcPrivateConnection syntax

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

VpcPrivateConnection properties

PropertyTypeRequiredEditableDescriptionConstraint
ConnectionPortIntegerYesYesThe port number used by the ApsaraDB for Redis instance to provide services. Valid values: 1024 to 65535.
ConnectionStringStringYesYesThe 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

PropertyTypeRequiredEditableDescriptionConstraint
ConnectionPortIntegerYesYesThe port number used by the ApsaraDB for Redis instance to provide services. Valid values: 1024 to 65535.
ConnectionStringStringYesYesThe 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

PropertyTypeRequiredEditableDescriptionConstraint
ConnectionPortIntegerYesYesThe port number used by the ApsaraDB for Redis instance to provide services. Valid values: 1024 to 65535.
ConnectionStringStringYesYesThe prefix of the private 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.

ClassicInnerConnection syntax

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

ClassicInnerConnection properties

PropertyTypeRequiredEditableDescriptionConstraint
ConnectionPortIntegerYesYesThe port number used by the ApsaraDB for Redis instance to provide services. Valid values: 1024 to 65535.
ConnectionStringStringYesYesThe 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.

Return values

Fn::GetAtt

  • InstanceId: the ID of the instance.
  • OrderId: the order ID of the instance.
  • ConnectionDomain: the private endpoint that is used to connect to the instance.
  • Port: the port number used by the ApsaraDB for Redis instance to provide services.
  • InstanceName: the name of the instance.
  • InstanceClass: the specifications of the instance.
  • VpcId: the ID of the VPC.
  • Capacity: the storage capacity of the instance.
  • InstanceType: the database engine of the instance.
  • ChargeType: the billing method of the instance.
  • PackageType: the type of the resource plan.
  • 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 scaling orders within the Alibaba Cloud account.
  • ResourceGroupId: the ID of the resource group.
  • QPS: the queries per second (QPS). The value indicates the expected QPS.
  • ZoneId: the ID of the zone in which the instance resides.
  • Bandwidth: the bandwidth of the instance. Unit: Mbit/s.
  • EngineVersion: the database engine version of the instance.
  • NetworkType: the network type of the instance.
  • VSwitchId: the ID of the vSwitch.
  • 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 allows you 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 allows you 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 allows you to access the instance by using the private endpoint in direct connection mode.
  • ClassicInnerConnectionPort: the port number that allows you 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:
          zh-cn: Before you create an instance, check whether the zone in which the instance is created supports the specifications of Redis resources. 
          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.json and Instance.yml. In the examples, the ALIYUN::REDIS::Instance, ALIYUN::REDIS::Whitelist, and ALIYUN::REDIS::Account resource types are used.