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,
"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
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
EngineVersion | String | No | No | The database engine version of the instance. | Valid values:
|
InstanceClass | String | No | Yes | The instance type. | You must specify the Capacity property or the InstanceClass property.
For more information, see Overview. |
InstanceMaintainTime | Map | No | Yes | The maintenance window of the instance. | None |
Tags | List | No | No | The tags of the instance. | You can add up to 20 tags to each instance.
For more information, see Tags properties. |
VpcPasswordFree | Boolean | No | 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:
|
VpcId | String | No | No | The ID of the VPC. | None |
Capacity | Integer | No | No | The storage capacity of the instance. | You must specify the Capacity property or the InstanceClass property. |
EvictionPolicy | String | No | No | The data eviction policy. | Valid values:
|
ZoneId | String | No | No | The ID of the zone. | 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 in the VPC. | None |
SecurityGroupId | String | No | Yes | The ID of the security group. | You can specify up to 10 security group IDs. Separate multiple security group IDs with commas (,). |
Password | String | No | No | The password that is used to access the instance. | The password must be 8 to 30 characters in length, and can contain uppercase letters, lowercase letters, and digits. |
SSLEnabled | String | No | Yes | The status of SSL encryption. | Valid values:
|
InstanceName | String | No | Yes | The name of the instance. | The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), hyphens (-), and periods (.). It must start with a letter. |
DeletionForce | Boolean | No | Yes | Specifies whether to delete the instance when the instance is reclaimed. | Default value: false. Valid values:
|
Connections | Map | No | Yes | The endpoint 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 cluster. | Default value: PostPaid. Valid values:
|
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: months |
AutoRenewDuration | Integer | No | Yes | The 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 duration that is specified by this property. Note This property only takes effect if you set the ChargeType property to PrePaid.
|
BackupPolicy syntax
"BackupPolicy": {
"PreferredBackupPeriod": "String",
"PreferredBackupTime": "String",
"EnableBackupLog": "Integer"
}
BackupPolicy properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
PreferredBackupPeriod | String | Yes | Yes | The days on which backups are performed. | Valid values:
|
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:
|
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 you want the maintenance window
to start at 01: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 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
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Key | String | Yes | No | The tag key. | Each tag key must be unique to an Alibaba Cloud account within 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. If your instance is a cluster instance, you can request a private endpoint 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 ApsaraDB for Redis instance to provide services. | Valid values: 1024 to 65535. |
ConnectionString | String | Yes | Yes | The prefix of the endpoint. | The prefix must be 8 to 64 characters in length, and can contain lowercase letters and digits. It 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 ApsaraDB for Redis instance to provide services. | Valid values: 1024 to 65535. |
ConnectionString | String | Yes | Yes | The prefix of the endpoint. | The prefix must be 8 to 64 characters in length, and can contain lowercase letters and digits. It 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 ApsaraDB for Redis instance to provide services. | Valid values: 1024 to 65535. |
ConnectionString | String | Yes | Yes | The prefix of the endpoint. | The prefix must be 8 to 64 characters in length and can contain lowercase letters and digits. |
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 ApsaraDB for Redis instance to provide services. | Valid values: 1024 to 65535. |
ConnectionString | String | Yes | Yes | The prefix of the endpoint. | The prefix must be 8 to 64 characters in length and can contain lowercase letters and digits. It 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 endpoint that is used to connect to the instance.
- Port: the service port of the ApsaraDB for Redis instance.
- InstanceName: the name of the instance.
- InstanceClass: the instance type.
- VpcId: the ID of the VPC.
- Capacity: the storage capacity of the instance.
- InstanceType: the database engine type of the instance.
- ChargeType: the billing method of the instance.
- PackageType: the type of the plan.
- Connections: the maximum number of connections that are supported by the instance.
- ArchitectureType: the architecture type.
- NodeType: the node type.
- HasRenewChangeOrder: indicates whether the instance has pending renewal or configuration upgrade orders within the current Alibaba Cloud account.
- ResourceGroupId: the ID of the resource group.
- QPS: the queries per second. The value is set to the expected maximum QPS.
- ZoneId: the ID of the zone to which the instance belongs.
- 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 public endpoint that is used to access the instance.
- VpcPrivateConnectionPort: the port that allows users to access the instance by using the VPC endpoint.
- ClassicInnerConnectionString: the classic network endpoint that is used to access the instance.
- VpcPrivateConnectionString: the VPC endpoint that is used to access the instance.
- PublicConnectionPort: the port that allows users to access the instance by using the public endpoint.
- DirectConnectionString: the private endpoint that is used to access the instance.
- DirectConnectionPort: the port that allows users to access the instance by using the private endpoint.
- ClassicInnerConnectionPort: the port that allows users to access the instance by using the classic network endpoint.
Examples
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"en": "Alibaba Cloud ROS Sample Template: Create a Redis instance of a VPC network type."
},
"Parameters": {
"InstanceClass": {
"Type": "String",
"Default": "redis.master.small.default",
"Label": {
"en": "Instance Type"
}
},
"EvictionPolicy": {
"Label": {
"en": "Eviction Policy"
},
"AllowedValues": [
"noeviction",
"allkeys-lru",
"volatile-lru",
"allkeys-random",
"volatile-random",
"volatile-ttl"
],
"Description": {
"en": "Cache data eviction strategy: volatile-lru(Most recently used expired data), volatile-ttl(Being expiring data), volatile-random(Any expired data), allkeys-lru(Least recently used data), allkeys-random(Arbitrarily select data), and no-enviction(Do not delete any data)."
},
"Type": "String",
"Default": "noeviction"
},
"InstanceName": {
"Type": "String",
"Description": {
"en": "The instance name, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'."
},
"Label": {
"en": "Instance Name"
},
"Default": "DefaultRedis"
},
"Password": {
"NoEcho": true,
"Type": "String",
"Description": {
"en": "Length 8-32 characters, can contain size letters, Numbers and special symbols, including:! @ # $ % ^ * ( ) _ + - =",
},
"Label": {
"en": "Instance Password",
},
"ConstraintDescription": {
"en": "8-32 characters, can contain size letters, Numbers and special symbols, including:! @ # $ % ^ * ( ) _ + - =",
},
"MinLength": "8",
"MaxLength": "32"
},
"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",
}
}
},
"Resources": {
"EcsVpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": "192.168.0.0/16"
}
},
"EcsVSwitch": {
"DependsOn": "EcsVpc",
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"VpcId": {
"Ref": "EcsVpc"
},
"ZoneId": {
"Ref": "ZoneId"
},
"CidrBlock": "192.168.10.0/24"
}
},
"RedisInstance": {
"DependsOn": "EcsVSwitch",
"Type": "ALIYUN::REDIS::Instance",
"Properties": {
"VpcId": {
"Ref": "EcsVpc"
},
"VSwitchId": {
"Ref": "EcsVSwitch"
},
"InstanceClass": {
"Ref": "InstanceClass"
},
"EvictionPolicy": {
"Ref": "EvictionPolicy"
},
"ZoneId": {
"Ref": "ZoneId"
},
"InstanceName": {
"Ref": "InstanceName"
},
"Password": {
"Ref": "Password"
}
}
}
},
"Outputs": {
"InstanceId": {
"Value": {
"Fn::GetAtt": [
"RedisInstance",
"InstanceId"
]
}
}
}
}
To view more examples, visit Instance.json and Instance.yml. In the examples, the ALIYUN::REDIS::Account, ALIYUN::REDIS::Instance, and ALIYUN::REDIS::Whitelist resource types are used.