ALIYUN::REDIS::Instance is used to create an ApsaraDB for Redis instance.

Syntax

{
  "Type": "ALIYUN::REDIS::Instance",
  "Properties": {
    "VpcId": String,
    "Capacity": Integer,
    "EvictionPolicy": String,
    "BackupPolicy": Map,
    "ZoneId": String,
    "InstanceClass": String,
    "InstanceConnection": Map,
    "InstanceMaintainTime": Map,
    "Tags": List,
    "VpcPasswordFree": Boolean,
    "VSwitchId": String,
    "SecurityGroupId": String,
    "EngineVersion": String,
    "SSLEnabled": String,
    "Password": String,
    "InstanceName": String
  }
}

Properties

Property Type Required Editable Description Constraint
EngineVersion String No No The version of the database engine that the instance runs. Valid values:
  • 2.8
    Note This version is unavailable. Select another one.
  • 4.0
  • 5.0
InstanceClass String No Yes The instance type. You must specify at least one of the Capacity and InstanceClass parameters.

For more information, see Overview.

InstanceMaintainTime Map No Yes The maintenance window of the instance. None
Tags List No No The list of one or more tags of the instance. You can bind up to 20 tags to an instance.

For more information, see the Tags properties section.

VpcPasswordFree Boolean No No Specifies whether to enable the password-free feature for access to the instance from a VPC. Valid values:
  • true
  • false
VpcId String No No The ID of the VPC. None
Capacity Integer No No The storage capacity of the instance. You must specify at least one of the Capacity and InstanceClass parameters.
InstanceConnection Map No Yes The endpoint and port configurations of the instance. None
EvictionPolicy String No No The data eviction policy. Valid values:
  • noeviction: specifies that the system does not evict any keys, but returns an error for write operations.
  • allkeys-lru: specifies to evict the approximated least recently used (LRU) keys.
  • volatile-lru: specifies to evict the approximated LRU keys among keys that have time-to-live (TTL) values configured.
  • allkeys-random: specifies to evict random keys.
  • volatile-random: specifies to evict random keys among keys that have TTL values configured.
  • volatile-ttl: specifies to evict keys that have the minimum TTL. The LRU, LFU, and volatile-ttl policies use approximated randomized algorithms.
ZoneId String No No The zone ID of the instance. This parameter 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 zones where ApsaraDB for Redis instances can be created.

VSwitchId String No No The ID of the vSwitch within the VPC. None
SecurityGroupId String No Yes The ID of the security group. A maximum of 10 security groups can be specified. Separate multiple security group IDs with commas (,).
Password String No No The password of the instance. 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 SSL encryption. Valid values:
  • Disable: SSL encryption is disabled.
  • Enable: SSL encryption is enabled.
  • Update: The SSL certificate that is issued by CA is updated.
InstanceName String No Yes The name of the instance. The name must be 2 to 128 characters in length. It can contain letters, digits, underscores (_), hyphens (-), and periods (.). It must start with a letter.
BackupPolicy Map No Yes The backup policy. For more information, see the BackupPolicy properties section.

BackupPolicy syntax

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

BackupPolicy properties

Property Type Required Editable Description Constraint
PreferredBackupPeriod String Yes Yes The backup cycle. Valid values:
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
PreferredBackupTime String Yes Yes The backup window. Specify the window in the HH:mmZ-HH:mmZ format.
EnableBackupLog Integer No Yes Specifies whether to enable incremental backup. Default value: 0. Valid values:
  • 1: enables incremental backup.
  • 0: disables incremental backup.

InstanceConnection syntax

"InstanceConnection": {
  "NewConnectionString": "String",
  "IPType": "String",
  "Port": "Integer"
}

InstanceConnection properties

Property Type Required Editable Description Constraint
NewConnectionString String No No The prefix of the new endpoint. Specify the endpoint in the <Prefix>.redis.rds.aliyuncs.com format.

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

IPType String No No The network type of the endpoint. Value values:
  • Private: VPC
  • Public: Internet
Port Integer No No The service port of the instance. Valid values: 1024 to 65535.

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 HH:mmZ format. The time must be in UTC. For example, if the maintenance starts at 1:00 (UTC+8), you must set this parameter to 17:00Z.
MaintainEndTime String No No The end time of the maintenance window. Specify the time in the HH:mmZ format. The time must be in UTC. For example, if the maintenance ends at 2:00 (UTC+8), you must set this parameter to 18:00Z.
Note The end time must be one hour later than the start time. For example, if the MaintainStartTime parameter is set to 17:00Z, the MaintainEndTime parameter must be set to 18:00Z.

Tags syntax

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

Tags properties

Property Type Required Editable Description Constraint
Key String Yes No The key of the tag. Each tag key must be unique to an Alibaba Cloud account within a region.
Value String No No The value of the tag. None

Response parameters

Fn::GetAtt

  • InstanceId: the ID of the instance.
  • OrderId: the ID of the order.
  • ConnectionDomain: the domain name that is used to connect to the instance.
  • Port: the port that is used to connect to the instance.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "EngineVersion": {
      "Type": "String",
      "Description": "Engine version. Supported values: 2.8, 4.0 and 5.0. ",
      "AllowedValues": [
        "2.8",
        "4.0",
        "5.0"
      ]
    },
    "EvictionPolicy": {
      "Type": "String",
      "Description": "The eviction policy of cache data storage.",
      "AllowedValues": [
        "noeviction",
        "allkeys-lru",
        "volatile-lru",
        "allkeys-random",
        "volatile-random",
        "volatile-ttl"
      ]
    },
    "ZoneId": {
      "Type": "String",
      "Description": "The zone id of input region."
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "The vSwitch Id to create ecs instance."
    },
    "SecurityGroupId": {
      "Type": "String",
      "Description": "The IDs of security groups. Separate multiple security group IDs with commas (,) and up to 10 can be set."
    },
    "InstanceMaintainTime": {
      "Type": "Json",
      "Description": "Instance maintain time. "
    },
    "InstanceClass": {
      "Type": "String",
      "Description": "Redis instance type. Refer the Redis instance type reference, such as 'redis.master.small.default', 'redis.master.4xlarge.default', 'redis.sharding.mid.default' etc"
    },
    "VpcPasswordFree": {
      "Type": "Boolean",
      "Description": "Specifies whether to enable password free for access within the VPC. If set to:\n- true: enables password free.\n- false: disables password free.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "InstanceConnection": {
      "Type": "Json",
      "Description": "Instance connection message."
    },
    "InstanceName": {
      "Type": "String",
      "Description": "Display name of the instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'"
    },
    "VpcId": {
      "Type": "String",
      "Description": "The VPC id to create ecs instance."
    },
    "SSLEnabled": {
      "Type": "String",
      "Description": "Modifies the SSL status. Valid values:\nDisable: disables SSL encryption.\nEnable: enables SSL encryption.\nUpdate: updates the SSL certificate.",
      "AllowedValues": [
        "Disable",
        "Enable",
        "Update"
      ]
    },
    "Capacity": {
      "Type": "Number",
      "Description": "The storage capacity of redis instance.range from 1 to 512, in GB.",
      "AllowedValues": [
        1,
        2,
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512
      ]
    },
    "Tags": {
      "Type": "Json",
      "Description": "Tags to attach to redis. Max support 20 tags to add during create redis. Each tag with two properties Key and Value, and Key is required.",
      "MaxLength": 20
    },
    "BackupPolicy": {
      "Type": "Json",
      "Description": "Backup policy"
    },
    "Password": {
      "Type": "String",
      "Description": "The password of redis instance.length 8 to 30 characters, need to contain both uppercase and lowercase letters and numbers"
    }
  },
  "Resources": {
    "KvInstance": {
      "Type": "ALIYUN::REDIS::Instance",
      "Properties": {
        "EngineVersion": {
          "Ref": "EngineVersion"
        },
        "EvictionPolicy": {
          "Ref": "EvictionPolicy"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "SecurityGroupId": {
          "Ref": "SecurityGroupId"
        },
        "InstanceMaintainTime": {
          "Ref": "InstanceMaintainTime"
        },
        "InstanceClass": {
          "Ref": "InstanceClass"
        },
        "VpcPasswordFree": {
          "Ref": "VpcPasswordFree"
        },
        "InstanceConnection": {
          "Ref": "InstanceConnection"
        },
        "InstanceName": {
          "Ref": "InstanceName"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "SSLEnabled": {
          "Ref": "SSLEnabled"
        },
        "Capacity": {
          "Ref": "Capacity"
        },
        "Tags": {
          "Ref": "Tags"
        },
        "BackupPolicy": {
          "Ref": "BackupPolicy"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  },
  "Outputs": {
    "ConnectionDomain": {
      "Description": "Connection domain of created instance.",
      "Value": {
        "Fn::GetAtt": [
          "KvInstance",
          "ConnectionDomain"
        ]
      }
    },
    "InstanceId": {
      "Description": "Instance id for created redis instance.",
      "Value": {
        "Fn::GetAtt": [
          "KvInstance",
          "InstanceId"
        ]
      }
    },
    "Port": {
      "Description": "Port of created instance.",
      "Value": {
        "Fn::GetAtt": [
          "KvInstance",
          "Port"
        ]
      }
    },
    "OrderId": {
      "Description": "Order Id of created instance.",
      "Value": {
        "Fn::GetAtt": [
          "KvInstance",
          "OrderId"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  EngineVersion:
    Type: String
    Description: 'Engine version. Supported values: 2.8, 4.0 and 5.0. '
    AllowedValues:
      - '2.8'
      - '4.0'
      - '5.0'
  EvictionPolicy:
    Type: String
    Description: The eviction policy of cache data storage.
    AllowedValues:
      - noeviction
      - allkeys-lru
      - volatile-lru
      - allkeys-random
      - volatile-random
      - volatile-ttl
  ZoneId:
    Type: String
    Description: The zone id of input region.
  VSwitchId:
    Type: String
    Description: The vSwitch Id to create ecs instance.
  SecurityGroupId:
    Type: String
    Description: >-
      The IDs of security groups. Separate multiple security group IDs with
      commas (,) and up to 10 can be set.
  InstanceMaintainTime:
    Type: Json
    Description: 'Instance maintain time. '
  InstanceClass:
    Type: String
    Description: >-
      Redis instance type. Refer the Redis instance type reference, such as
      'redis.master.small.default', 'redis.master.4xlarge.default',
      'redis.sharding.mid.default' etc
  VpcPasswordFree:
    Type: Boolean
    Description: >-
      Specifies whether to enable password free for access within the VPC. If
      set to:

      - true: enables password free.

      - false: disables password free.
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  InstanceConnection:
    Type: Json
    Description: Instance connection message.
  InstanceName:
    Type: String
    Description: >-
      Display name of the instance, [2, 128] English or Chinese characters, must
      start with a letter or Chinese in size, can contain numbers, '_' or '.',
      '-'
  VpcId:
    Type: String
    Description: The VPC id to create ecs instance.
  SSLEnabled:
    Type: String
    Description: |-
      Modifies the SSL status. Valid values:
      Disable: disables SSL encryption.
      Enable: enables SSL encryption.
      Update: updates the SSL certificate.
    AllowedValues:
      - Disable
      - Enable
      - Update
  Capacity:
    Type: Number
    Description: 'The storage capacity of redis instance.range from 1 to 512, in GB.'
    AllowedValues:
      - 1
      - 2
      - 4
      - 8
      - 16
      - 32
      - 64
      - 128
      - 256
      - 512
  Tags:
    Type: Json
    Description: >-
      Tags to attach to redis. Max support 20 tags to add during create redis.
      Each tag with two properties Key and Value, and Key is required.
    MaxLength: 20
  BackupPolicy:
    Type: Json
    Description: Backup policy
  Password:
    Type: String
    Description: >-
      The password of redis instance.length 8 to 30 characters, need to contain
      both uppercase and lowercase letters and numbers
Resources:
  KvInstance:
    Type: 'ALIYUN::REDIS::Instance'
    Properties:
      EngineVersion:
        Ref: EngineVersion
      EvictionPolicy:
        Ref: EvictionPolicy
      ZoneId:
        Ref: ZoneId
      VSwitchId:
        Ref: VSwitchId
      SecurityGroupId:
        Ref: SecurityGroupId
      InstanceMaintainTime:
        Ref: InstanceMaintainTime
      InstanceClass:
        Ref: InstanceClass
      VpcPasswordFree:
        Ref: VpcPasswordFree
      InstanceConnection:
        Ref: InstanceConnection
      InstanceName:
        Ref: InstanceName
      VpcId:
        Ref: VpcId
      SSLEnabled:
        Ref: SSLEnabled
      Capacity:
        Ref: Capacity
      Tags:
        Ref: Tags
      BackupPolicy:
        Ref: BackupPolicy
      Password:
        Ref: Password
Outputs:
  ConnectionDomain:
    Description: Connection domain of created instance.
    Value:
      'Fn::GetAtt':
        - KvInstance
        - ConnectionDomain
  InstanceId:
    Description: Instance id for created redis instance.
    Value:
      'Fn::GetAtt':
        - KvInstance
        - InstanceId
  Port:
    Description: Port of created instance.
    Value:
      'Fn::GetAtt':
        - KvInstance
        - Port
  OrderId:
    Description: Order Id of created instance.
    Value:
      'Fn::GetAtt':
        - KvInstance
        - OrderId