ALIYUN::REDIS::PrepayInstance crea una instancia de Tair (Redis) bajo el modelo subscription.
Sintaxis
{
"Type": "ALIYUN::REDIS::PrepayInstance",
"Properties": {
"VpcId": String,
"EvictionPolicy": String,
"Period": Integer,
"ZoneId": String,
"InstanceClass": String,
"VpcPasswordFree": Boolean,
"VSwitchId": String,
"SecurityGroupId": String,
"EngineVersion": String,
"Password": String,
"SSLEnabled": String,
"InstanceName": String,
"BackupPolicy": Map,
"Tags": List,
"InstanceMaintainTime": Map,
"DeletionForce": Boolean,
"AutoPay": Boolean,
"Connections": Map,
"AutoRenewDuration": Integer,
"ProductType": String,
"SecondaryZoneId": String,
"ResourceGroupId": String,
"PeriodUnit": String,
"TairConfig": Map,
"ShardCount": Integer,
"ReadOnlyCount": Integer,
"SubscriptionDeletionForce": Boolean,
"NodeType": String,
"DeletionProtection": Boolean
}
}
Propiedades
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
AutoPay |
Boolean |
No |
No |
Indica si se habilita el pago automático. |
Valores válidos:
|
|
AutoRenewDuration |
Integer |
No |
Sí |
El periodo de renovación automática. |
Valores válidos: de 1 a 12. Unidad: mes. La instancia se renueva automáticamente durante este periodo antes de su vencimiento. |
|
BackupPolicy |
Map |
No |
Sí |
La política de copia de seguridad. |
Para más información, consulte BackupPolicy properties. |
|
Connections |
Map |
No |
Sí |
Los endpoints de la instancia. |
Para más información, consulte Connections properties. |
|
DeletionForce |
Boolean |
No |
Sí |
Indica si se elimina la instancia inmediatamente en lugar de moverla a la papelera de reciclaje. |
Valores válidos:
|
|
DeletionProtection |
Boolean |
No |
Sí |
Indica si se habilita la protección contra eliminación. |
Valores válidos:
|
|
EngineVersion |
String |
No |
Sí |
La versión del motor de base de datos. |
Valores válidos:
|
|
EvictionPolicy |
String |
No |
No |
La política de desalojo. |
Valores válidos:
|
|
InstanceClass |
String |
No |
Sí |
La especificación de la instancia. |
Para más información, consulte Instance Specifications Overview. |
|
InstanceMaintainTime |
Map |
No |
Sí |
La ventana de mantenimiento de la instancia. |
Para más información, consulte InstanceMaintainTime properties. |
|
InstanceName |
String |
No |
Sí |
El nombre de la instancia. |
Debe tener entre 2 y 128 caracteres. Debe comenzar con una letra o un carácter chino. Puede contener letras, dígitos, caracteres chinos, guiones bajos (_), guiones (-) y puntos (.). |
|
NodeType |
String |
No |
No |
El tipo de nodo. |
Valores válidos:
Nota
Para instancias de edición nativa en la nube, seleccione |
|
Password |
String |
No |
Sí |
La contraseña de la instancia. |
Debe tener entre 8 y 32 caracteres e incluir caracteres de como mínimo tres categorías: letras mayúsculas, letras minúsculas, dígitos y caracteres especiales. Caracteres especiales compatibles: |
|
Period |
Integer |
No |
No |
La duración de la suscripción. |
Valores válidos: de 1 a 9, 12, 24 y 36. Unidad: mes. |
|
PeriodUnit |
String |
No |
No |
La unidad de la duración de la suscripción. |
Valores válidos:
|
|
ProductType |
String |
No |
No |
El tipo de producto. |
Valores válidos:
|
|
ReadOnlyCount |
Integer |
No |
No |
El número de réplicas de lectura en la zona de disponibilidad principal. |
Nota
El parámetro ReadOnlyCount solo aplica a instancias de edición nativa en la nube con la función de división de lectura/escritura habilitada. Si la instancia utiliza arquitectura de clúster, este parámetro especifica el número de réplicas de lectura por fragmento. |
|
ResourceGroupId |
String |
No |
Sí |
El ID del resource group. |
Ninguna |
|
SecondaryZoneId |
String |
No |
Sí |
El ID de la zona de disponibilidad secundaria. |
Ejecute la operación DescribeZones para consultar los ID de zona de disponibilidad compatibles. Nota
Despliegue los nodos primarios y secundarios en diferentes zonas para implementar recuperación ante desastres entre zonas. |
|
SecurityGroupId |
String |
No |
Sí |
El ID del security group. |
Hasta 10 ID, separados por comas (,). |
|
ShardCount |
Integer |
No |
No |
El número de fragmentos. |
Valores válidos:
|
|
SSLEnabled |
String |
No |
Sí |
El estado del cifrado SSL. |
Valores válidos:
|
|
SubscriptionDeletionForce |
Boolean |
No |
No |
Solo para instancias subscription. Establezca este valor en |
Ninguna |
|
Tags |
List |
No |
Sí |
Las etiquetas de la instancia. |
Máximo de 20 etiquetas por instancia. Para más información, consulte Tags properties. |
|
TairConfig |
Map |
No |
No |
La configuración de Tair. |
Para más información, consulte TairConfig properties. |
|
TLSProtocol |
String |
No |
No |
La versión TLS de la instancia. |
Valores válidos:
|
|
VpcId |
String |
No |
No |
El ID de la VPC. |
Ninguna |
|
VpcPasswordFree |
Boolean |
No |
No |
Indica si se habilita el acceso sin contraseña dentro de la VPC. |
Valores válidos:
|
|
VSwitchId |
String |
No |
No |
El ID del vSwitch. |
Ninguna |
|
ZoneId |
String |
No |
No |
El ID de la zona de disponibilidad. |
Este parámetro es obligatorio para instancias en una VPC. Para desplegar una instancia en varias zonas de disponibilidad, utilice la operación DescribeZones para buscar los ID de zona compatibles. |
Sintaxis de BackupPolicy
"BackupPolicy": {
"PreferredBackupPeriod": "String",
"PreferredBackupTime": "String",
"EnableBackupLog": "Integer"
}
Propiedades de BackupPolicy
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
PreferredBackupPeriod |
String |
Sí |
Sí |
El día de la semana para la copia de seguridad. |
Valores válidos:
|
|
PreferredBackupTime |
String |
Sí |
Sí |
La ventana de tiempo de copia de seguridad en UTC. |
Formato: |
|
EnableBackupLog |
Integer |
No |
Sí |
Indica si se habilita la copia de seguridad incremental. |
Valores válidos:
|
Sintaxis de InstanceMaintainTime
"InstanceMaintainTime": {
"MaintainStartTime": "String",
"MaintainEndTime": "String"
}
Propiedades de InstanceMaintainTime
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
MaintainEndTime |
String |
No |
No |
La hora de finalización de la ventana de mantenimiento. |
Formato: Nota
La hora de finalización debe ser exactamente una hora después de la hora de inicio. Por ejemplo, si MaintainStartTime es |
|
MaintainStartTime |
String |
No |
No |
La hora de inicio de la ventana de mantenimiento. |
Formato: |
Sintaxis de Tags
"Tags": [
{
"Key": String,
"Value": String
}
]
Propiedades de Tags
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
Key |
String |
Sí |
No |
La clave de la etiqueta. |
La clave de la etiqueta debe ser única dentro de una cuenta y región. |
|
Value |
String |
No |
No |
El valor de la etiqueta. |
Ninguna |
Sintaxis de Connections
"Connections": {
"VpcPrivateConnection": "Map",
"ClassicInnerConnection": "Map",
"DirectConnection": "Map",
"PublicConnection": "Map"
}
Propiedades de Connections
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
ClassicInnerConnection |
Map |
No |
Sí |
El endpoint de red clásica. |
Para más información, consulte ClassicInnerConnection properties. |
|
DirectConnection |
Map |
No |
Sí |
El endpoint de conexión directa. |
Para más información, consulte DirectConnection properties. |
|
PublicConnection |
Map |
No |
Sí |
El endpoint público. |
Para más información, consulte PublicConnection properties. |
|
VpcPrivateConnection |
Map |
No |
Sí |
El endpoint de VPC. |
Para más información, consulte VpcPrivateConnection properties. |
Sintaxis de VpcPrivateConnection
"VpcPrivateConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
Propiedades de VpcPrivateConnection
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
ConnectionPort |
Integer |
Sí |
Sí |
El número de puerto para el servicio ApsaraDB en la instancia. |
Valores válidos: de 1024 a 65535. |
|
ConnectionString |
String |
No |
Sí |
El prefijo del endpoint de VPC. |
El prefijo debe tener entre 8 y 64 caracteres, comenzar con una letra minúscula y contener solo letras minúsculas y dígitos. |
Sintaxis de PublicConnection
"PublicConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
Propiedades de PublicConnection
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
ConnectionPort |
Integer |
Sí |
Sí |
Puerto de servicio de la instancia ApsaraDB. |
Valores válidos: de 1024 a 65535. |
|
ConnectionString |
String |
No |
Sí |
Prefijo del endpoint público. |
Debe tener entre 8 y 64 caracteres, comenzar con una letra minúscula y contener solo letras minúsculas y dígitos. |
Sintaxis de DirectConnection
"DirectConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
Propiedades de DirectConnection
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
ConnectionPort |
Integer |
Sí |
Sí |
El puerto de servicio de la instancia ApsaraDB. |
Valores válidos: de 1024 a 65535. |
|
ConnectionString |
String |
No |
Sí |
El prefijo del endpoint privado. |
El prefijo debe tener entre 8 y 64 caracteres, comenzar con una letra minúscula y contener solo letras minúsculas y dígitos. |
Sintaxis de ClassicInnerConnection
"ClassicInnerConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
Propiedades de ClassicInnerConnection
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
ConnectionPort |
Integer |
Sí |
Sí |
El puerto de servicio de la instancia ApsaraDB. |
Valores válidos: de 1024 a 65535. |
|
ConnectionString |
String |
No |
Sí |
El prefijo del endpoint de red clásica. |
El prefijo debe tener entre 8 y 64 caracteres, comenzar con una letra minúscula y contener solo letras minúsculas y dígitos. |
Sintaxis de TairConfig
"BackupPolicy": {
"Storage": "Integer",
"StorageType": "String",
"ShardCount": "Integer"
}
Propiedades de TairConfig
|
Propiedad |
Tipo |
Obligatorio |
Editable |
Descripción |
Restricciones |
|
ShardCount |
Integer |
No |
No |
Número de fragmentos de datos. |
Valores válidos:
|
|
Storage |
Integer |
No |
No |
Capacidad de almacenamiento del disco en la nube. |
Varía según la especificación de la instancia. Para más información, consulte ESSD/SSD-based instances. |
|
StorageType |
String |
No |
No |
Tipo de almacenamiento. |
Valores válidos:
|
Valores de retorno
Fn::GetAtt
InstanceId: ID de la instancia.
OrderId: ID del pedido.
ConnectionDomain: endpoint utilizado para acceder a la instancia.
Port: puerto utilizado para conectarse a la instancia.
InstanceName: nombre de la instancia.
InstanceClass: especificaciones de la instancia.
VpcId: ID de la VPC.
Capacity: capacidad de almacenamiento de la instancia.
InstanceType: tipo de motor de la instancia.
ChargeType: método de facturación de la instancia.
PackageType: tipo de plan.
Connections: número máximo de conexiones que admite la instancia.
ArchitectureType: tipo de arquitectura de la instancia.
NodeType: tipo de nodo de la instancia.
HasRenewChangeOrder: indica si la cuenta tiene un pedido pendiente de renovación o escalado.
ResourceGroupId: ID del resource group.
QPS: consultas por segundo (QPS) teóricas de la instancia.
ZoneId: ID de la zona de la instancia.
Bandwidth: ancho de banda de la instancia. Unidad: Mbps.
EngineVersion: versión del motor de la instancia.
NetworkType: tipo de red de la instancia.
VSwitchId: ID del vSwitch.
PrivateIp: dirección IP privada de la instancia.
PublicConnectionString: cadena de conexión pública de la instancia.
VpcPrivateConnectionPort: puerto utilizado para la conexión privada a la instancia dentro de una VPC.
ClassicInnerConnectionString: cadena de conexión interna de la instancia a través de la red clásica.
VpcPrivateConnectionString: cadena de conexión privada de VPC de la instancia.
PublicConnectionPort: puerto utilizado para la conexión pública a la instancia.
DirectConnectionString: cadena de conexión directa de la instancia.
DirectConnectionPort: puerto utilizado para la conexión directa a la instancia.
ClassicInnerConnectionPort: puerto utilizado para la conexión interna a la instancia a través de la red clásica.
Ejemplos
Escenario 1: crear una instancia de Redis edición estándar de suscripción desplegada en una red VPC.
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建包年包月Redis标准版实例,部署在VPC网络中。
en: Create a prepaid Redis standard instance in a VPC network.
Parameters:
ZoneId:
Type: String
Label:
zh-cn: 可用区
en: Availability Zone
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
VpcId:
Type: String
Label:
zh-cn: VPC ID
en: VPC ID
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitchId:
Type: String
Label:
zh-cn: 交换机ID
en: VSwitch ID
AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
InstanceName:
Type: String
Label:
zh-cn: 实例名称
en: Instance Name
Description:
zh-cn: Redis实例名称,2~128个字符。
en: Redis instance name, 2-128 characters.
Default: my-redis
InstanceClass:
Type: String
Label:
zh-cn: 实例规格
en: Instance Class
Description:
zh-cn: >-
Redis实例规格。例如:
redis.master.small.default(1GB主从版),
redis.master.mid.default(2GB主从版)。
en: >-
Redis instance class, e.g.
redis.master.small.default (1GB), redis.master.mid.default (2GB).
Default: redis.master.small.default
EngineVersion:
Type: String
Label:
zh-cn: 引擎版本
en: Engine Version
Default: '5.0'
AllowedValues:
- '4.0'
- '5.0'
Password:
Type: String
Label:
zh-cn: 实例密码
en: Instance Password
Description:
zh-cn: 8~32个字符,至少包含大小写字母、数字和特殊字符中的三种。
en: 8-32 characters, at least three of uppercase, lowercase, digits, special chars.
NoEcho: true
MinLength: 8
MaxLength: 32
Period:
Type: Number
Label:
zh-cn: 购买时长(月)
en: Period (Months)
Description:
zh-cn: 包年包月购买时长,单位月。
en: Subscription period in months.
Default: 1
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 12
- 24
- 36
Resources:
RedisInstance:
Type: ALIYUN::REDIS::PrepayInstance
Properties:
InstanceName:
Ref: InstanceName
InstanceClass:
Ref: InstanceClass
EngineVersion:
Ref: EngineVersion
Password:
Ref: Password
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
ZoneId:
Ref: ZoneId
Period:
Ref: Period
AutoPay: true
Outputs:
InstanceId:
Label:
zh-cn: 实例ID
en: Instance ID
Description:
zh-cn: Redis实例ID。
en: The Redis instance ID.
Value:
Fn::GetAtt:
- RedisInstance
- InstanceId
ConnectionDomain:
Label:
zh-cn: 连接域名
en: Connection Domain
Description:
zh-cn: Redis实例的内网连接域名。
en: The private connection domain of the Redis instance.
Value:
Fn::GetAtt:
- RedisInstance
- ConnectionDomain
Port:
Label:
zh-cn: 连接端口
en: Connection Port
Description:
zh-cn: Redis实例的连接端口。
en: The connection port of the Redis instance.
Value:
Fn::GetAtt:
- RedisInstance
- Port{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建包年包月Redis标准版实例,部署在VPC网络中。",
"en": "Create a prepaid Redis standard instance in a VPC network."
},
"Parameters": {
"ZoneId": {
"Type": "String",
"Label": {
"zh-cn": "可用区",
"en": "Availability Zone"
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
},
"VpcId": {
"Type": "String",
"Label": {
"zh-cn": "VPC ID",
"en": "VPC ID"
},
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"VSwitchId": {
"Type": "String",
"Label": {
"zh-cn": "交换机ID",
"en": "VSwitch ID"
},
"AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}",
"ZoneId": "${ZoneId}"
}
},
"InstanceName": {
"Type": "String",
"Label": {
"zh-cn": "实例名称",
"en": "Instance Name"
},
"Description": {
"zh-cn": "Redis实例名称,2~128个字符。",
"en": "Redis instance name, 2-128 characters."
},
"Default": "my-redis"
},
"InstanceClass": {
"Type": "String",
"Label": {
"zh-cn": "实例规格",
"en": "Instance Class"
},
"Description": {
"zh-cn": "Redis实例规格。例如:redis.master.small.default(1GB主从版),redis.master.mid.default(2GB主从版)。",
"en": "Redis instance class, e.g. redis.master.small.default (1GB), redis.master.mid.default (2GB)."
},
"Default": "redis.master.small.default"
},
"EngineVersion": {
"Type": "String",
"Label": {
"zh-cn": "引擎版本",
"en": "Engine Version"
},
"Default": "5.0",
"AllowedValues": [
"4.0",
"5.0"
]
},
"Password": {
"Type": "String",
"Label": {
"zh-cn": "实例密码",
"en": "Instance Password"
},
"Description": {
"zh-cn": "8~32个字符,至少包含大小写字母、数字和特殊字符中的三种。",
"en": "8-32 characters, at least three of uppercase, lowercase, digits, special chars."
},
"NoEcho": true,
"MinLength": 8,
"MaxLength": 32
},
"Period": {
"Type": "Number",
"Label": {
"zh-cn": "购买时长(月)",
"en": "Period (Months)"
},
"Description": {
"zh-cn": "包年包月购买时长,单位月。",
"en": "Subscription period in months."
},
"Default": 1,
"AllowedValues": [1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36]
}
},
"Resources": {
"RedisInstance": {
"Type": "ALIYUN::REDIS::PrepayInstance",
"Properties": {
"InstanceName": {
"Ref": "InstanceName"
},
"InstanceClass": {
"Ref": "InstanceClass"
},
"EngineVersion": {
"Ref": "EngineVersion"
},
"Password": {
"Ref": "Password"
},
"VpcId": {
"Ref": "VpcId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"ZoneId": {
"Ref": "ZoneId"
},
"Period": {
"Ref": "Period"
},
"AutoPay": true
}
}
},
"Outputs": {
"InstanceId": {
"Label": {
"zh-cn": "实例ID",
"en": "Instance ID"
},
"Description": {
"zh-cn": "Redis实例ID。",
"en": "The Redis instance ID."
},
"Value": {
"Fn::GetAtt": [
"RedisInstance",
"InstanceId"
]
}
},
"ConnectionDomain": {
"Label": {
"zh-cn": "连接域名",
"en": "Connection Domain"
},
"Description": {
"zh-cn": "Redis实例的内网连接域名。",
"en": "The private connection domain of the Redis instance."
},
"Value": {
"Fn::GetAtt": [
"RedisInstance",
"ConnectionDomain"
]
}
},
"Port": {
"Label": {
"zh-cn": "连接端口",
"en": "Connection Port"
},
"Description": {
"zh-cn": "Redis实例的连接端口。",
"en": "The connection port of the Redis instance."
},
"Value": {
"Fn::GetAtt": [
"RedisInstance",
"Port"
]
}
}
}
}Escenario 2: crear una instancia de Redis de suscripción con política de copia de seguridad, ventana de mantenimiento, SSL y etiquetas.
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建包年包月Redis实例,配置备份策略、维护窗口、SSL和标签。
en: Create a prepaid Redis instance with backup policy, maintenance window, SSL and tags.
Parameters:
ZoneId:
Type: String
Label:
zh-cn: 可用区
en: Availability Zone
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
VpcId:
Type: String
Label:
zh-cn: VPC ID
en: VPC ID
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitchId:
Type: String
Label:
zh-cn: 交换机ID
en: VSwitch ID
AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
SecurityGroupId:
Type: String
Label:
zh-cn: 安全组ID
en: Security Group ID
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: ${VpcId}
InstanceName:
Type: String
Label:
zh-cn: 实例名称
en: Instance Name
Default: prod-redis
InstanceClass:
Type: String
Label:
zh-cn: 实例规格
en: Instance Class
Default: redis.master.mid.default
Password:
Type: String
Label:
zh-cn: 实例密码
en: Instance Password
NoEcho: true
MinLength: 8
MaxLength: 32
Period:
Type: Number
Label:
zh-cn: 购买时长(月)
en: Period (Months)
Default: 3
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 12
- 24
- 36
AutoRenewDuration:
Type: Number
Label:
zh-cn: 自动续费时长(月)
en: Auto Renew Duration (Months)
Description:
zh-cn: 实例到期后自动续费的月数,1~12个月。设为0则不自动续费。
en: Auto-renew duration in months (1-12). Set to 0 to disable.
Default: 1
MinValue: 0
MaxValue: 12
Resources:
RedisInstance:
Type: ALIYUN::REDIS::PrepayInstance
Properties:
InstanceName:
Ref: InstanceName
InstanceClass:
Ref: InstanceClass
EngineVersion: '5.0'
NodeType: MASTER_SLAVE
Password:
Ref: Password
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
ZoneId:
Ref: ZoneId
SecurityGroupId:
Ref: SecurityGroupId
Period:
Ref: Period
AutoPay: true
AutoRenewDuration:
Ref: AutoRenewDuration
SSLEnabled: Enable
DeletionProtection: true
BackupPolicy:
PreferredBackupPeriod: Monday,Wednesday,Friday
PreferredBackupTime: 18:00Z-19:00Z
EnableBackupLog: 1
InstanceMaintainTime:
MaintainStartTime: 17:00Z
MaintainEndTime: 18:00Z
Tags:
- Key: Environment
Value: Production
- Key: Service
Value: Cache
Outputs:
InstanceId:
Label:
zh-cn: 实例ID
en: Instance ID
Value:
Fn::GetAtt:
- RedisInstance
- InstanceId
ConnectionDomain:
Label:
zh-cn: 连接域名
en: Connection Domain
Value:
Fn::GetAtt:
- RedisInstance
- ConnectionDomain
Port:
Label:
zh-cn: 连接端口
en: Connection Port
Value:
Fn::GetAtt:
- RedisInstance
- Port
InstanceClass:
Label:
zh-cn: 实例规格
en: Instance Class
Value:
Fn::GetAtt:
- RedisInstance
- InstanceClass{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建包年包月Redis实例,配置备份策略、维护窗口、SSL和标签。",
"en": "Create a prepaid Redis instance with backup policy, maintenance window, SSL and tags."
},
"Parameters": {
"ZoneId": {
"Type": "String",
"Label": {
"zh-cn": "可用区",
"en": "Availability Zone"
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
},
"VpcId": {
"Type": "String",
"Label": {
"zh-cn": "VPC ID",
"en": "VPC ID"
},
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"VSwitchId": {
"Type": "String",
"Label": {
"zh-cn": "交换机ID",
"en": "VSwitch ID"
},
"AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}",
"ZoneId": "${ZoneId}"
}
},
"SecurityGroupId": {
"Type": "String",
"Label": {
"zh-cn": "安全组ID",
"en": "Security Group ID"
},
"AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}"
}
},
"InstanceName": {
"Type": "String",
"Label": {
"zh-cn": "实例名称",
"en": "Instance Name"
},
"Default": "prod-redis"
},
"InstanceClass": {
"Type": "String",
"Label": {
"zh-cn": "实例规格",
"en": "Instance Class"
},
"Default": "redis.master.mid.default"
},
"Password": {
"Type": "String",
"Label": {
"zh-cn": "实例密码",
"en": "Instance Password"
},
"NoEcho": true,
"MinLength": 8,
"MaxLength": 32
},
"Period": {
"Type": "Number",
"Label": {
"zh-cn": "购买时长(月)",
"en": "Period (Months)"
},
"Default": 3,
"AllowedValues": [1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36]
},
"AutoRenewDuration": {
"Type": "Number",
"Label": {
"zh-cn": "自动续费时长(月)",
"en": "Auto Renew Duration (Months)"
},
"Description": {
"zh-cn": "实例到期后自动续费的月数,1~12个月。设为0则不自动续费。",
"en": "Auto-renew duration in months (1-12). Set to 0 to disable."
},
"Default": 1,
"MinValue": 0,
"MaxValue": 12
}
},
"Resources": {
"RedisInstance": {
"Type": "ALIYUN::REDIS::PrepayInstance",
"Properties": {
"InstanceName": {
"Ref": "InstanceName"
},
"InstanceClass": {
"Ref": "InstanceClass"
},
"EngineVersion": "5.0",
"NodeType": "MASTER_SLAVE",
"Password": {
"Ref": "Password"
},
"VpcId": {
"Ref": "VpcId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"ZoneId": {
"Ref": "ZoneId"
},
"SecurityGroupId": {
"Ref": "SecurityGroupId"
},
"Period": {
"Ref": "Period"
},
"AutoPay": true,
"AutoRenewDuration": {
"Ref": "AutoRenewDuration"
},
"SSLEnabled": "Enable",
"DeletionProtection": true,
"BackupPolicy": {
"PreferredBackupPeriod": "Monday,Wednesday,Friday",
"PreferredBackupTime": "18:00Z-19:00Z",
"EnableBackupLog": 1
},
"InstanceMaintainTime": {
"MaintainStartTime": "17:00Z",
"MaintainEndTime": "18:00Z"
},
"Tags": [
{
"Key": "Environment",
"Value": "Production"
},
{
"Key": "Service",
"Value": "Cache"
}
]
}
}
},
"Outputs": {
"InstanceId": {
"Label": {
"zh-cn": "实例ID",
"en": "Instance ID"
},
"Value": {
"Fn::GetAtt": [
"RedisInstance",
"InstanceId"
]
}
},
"ConnectionDomain": {
"Label": {
"zh-cn": "连接域名",
"en": "Connection Domain"
},
"Value": {
"Fn::GetAtt": [
"RedisInstance",
"ConnectionDomain"
]
}
},
"Port": {
"Label": {
"zh-cn": "连接端口",
"en": "Connection Port"
},
"Value": {
"Fn::GetAtt": [
"RedisInstance",
"Port"
]
}
},
"InstanceClass": {
"Label": {
"zh-cn": "实例规格",
"en": "Instance Class"
},
"Value": {
"Fn::GetAtt": [
"RedisInstance",
"InstanceClass"
]
}
}
}
}Escenario 3: crear una instancia de Redis edición clúster de suscripción con recuperación ante desastres entre zonas, división de lectura/escritura y resource group.
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建包年包月Redis集群版实例,配置跨可用区容灾、读写分离和资源组。
en: Create a prepaid Redis cluster instance with cross-zone HA, read-write splitting and resource group.
Parameters:
ZoneId:
Type: String
Label:
zh-cn: 主可用区
en: Primary Zone
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
SecondaryZoneId:
Type: String
Label:
zh-cn: 备可用区
en: Secondary Zone
Description:
zh-cn: >-
备可用区ID,用于跨可用区容灾。
建议选择与主可用区不同的可用区。
en: >-
Secondary zone ID for cross-zone disaster recovery.
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
VpcId:
Type: String
Label:
zh-cn: VPC ID
en: VPC ID
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitchId:
Type: String
Label:
zh-cn: 交换机ID
en: VSwitch ID
AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
InstanceName:
Type: String
Label:
zh-cn: 实例名称
en: Instance Name
Default: prod-redis-cluster
InstanceClass:
Type: String
Label:
zh-cn: 实例规格
en: Instance Class
Description:
zh-cn: >-
Redis集群版实例规格。例如:
redis.shard.small.ce(1GB集群版),
redis.shard.mid.ce(2GB集群版)。
en: >-
Redis cluster instance class, e.g.
redis.shard.small.ce (1GB), redis.shard.mid.ce (2GB).
Default: redis.shard.small.ce
Password:
Type: String
Label:
zh-cn: 实例密码
en: Instance Password
NoEcho: true
MinLength: 8
MaxLength: 32
ShardCount:
Type: Number
Label:
zh-cn: 分片数
en: Shard Count
Description:
zh-cn: 集群版分片数量,取值范围2~32。
en: Number of shards for the cluster, range 2-32.
Default: 4
MinValue: 2
MaxValue: 32
ReadOnlyCount:
Type: Number
Label:
zh-cn: 只读节点数
en: Read-Only Node Count
Description:
zh-cn: 每个分片的只读节点数量,用于读写分离。设为0则不启用。
en: Number of read-only nodes per shard for read-write splitting. Set to 0 to disable.
Default: 1
MinValue: 0
MaxValue: 5
EvictionPolicy:
Type: String
Label:
zh-cn: 数据逐出策略
en: Eviction Policy
Description:
zh-cn: >-
内存不足时的数据逐出策略。
noeviction:不删除,写操作返回错误。
allkeys-lru:优先删除最近最少使用的key。
volatile-lru:仅对设置了过期时间的key执行LRU淘汰。
volatile-ttl:仅删除过期时间最短的key。
en: >-
Data eviction policy when memory is full.
Default: volatile-lru
AllowedValues:
- noeviction
- allkeys-lru
- volatile-lru
- allkeys-random
- volatile-random
- volatile-ttl
ResourceGroupId:
Type: String
Label:
zh-cn: 资源组ID
en: Resource Group ID
Description:
zh-cn: 实例所属的资源组ID。
en: The resource group ID.
AssociationProperty: ALIYUN::ResourceManager::ResourceGroup
Default: ''
Period:
Type: Number
Label:
zh-cn: 购买时长(月)
en: Period (Months)
Default: 6
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 12
- 24
- 36
Resources:
RedisCluster:
Type: ALIYUN::REDIS::PrepayInstance
Properties:
InstanceName:
Ref: InstanceName
InstanceClass:
Ref: InstanceClass
EngineVersion: '5.0'
NodeType: MASTER_SLAVE
ProductType: OnECS
Password:
Ref: Password
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
ZoneId:
Ref: ZoneId
SecondaryZoneId:
Ref: SecondaryZoneId
ShardCount:
Ref: ShardCount
ReadOnlyCount:
Ref: ReadOnlyCount
EvictionPolicy:
Ref: EvictionPolicy
ResourceGroupId:
Ref: ResourceGroupId
Period:
Ref: Period
AutoPay: true
AutoRenewDuration: 1
DeletionProtection: true
DeletionForce: false
BackupPolicy:
PreferredBackupPeriod: Monday,Wednesday,Friday,Sunday
PreferredBackupTime: 18:00Z-19:00Z
EnableBackupLog: 1
Tags:
- Key: Environment
Value: Production
- Key: Architecture
Value: Cluster
Outputs:
InstanceId:
Label:
zh-cn: 实例ID
en: Instance ID
Value:
Fn::GetAtt:
- RedisCluster
- InstanceId
ConnectionDomain:
Label:
zh-cn: 连接域名
en: Connection Domain
Value:
Fn::GetAtt:
- RedisCluster
- ConnectionDomain
Port:
Label:
zh-cn: 连接端口
en: Connection Port
Value:
Fn::GetAtt:
- RedisCluster
- Port
Capacity:
Label:
zh-cn: 存储容量
en: Storage Capacity
Description:
zh-cn: Redis实例的存储容量。
en: The storage capacity of the Redis instance.
Value:
Fn::GetAtt:
- RedisCluster
- Capacity
OrderId:
Label:
zh-cn: 订单ID
en: Order ID
Description:
zh-cn: 预付费订单ID。
en: The prepaid order ID.
Value:
Fn::GetAtt:
- RedisCluster
- OrderId{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "创建包年包月Redis集群版实例,配置跨可用区容灾、读写分离和资源组。",
"en": "Create a prepaid Redis cluster instance with cross-zone HA, read-write splitting and resource group."
},
"Parameters": {
"ZoneId": {
"Type": "String",
"Label": {
"zh-cn": "主可用区",
"en": "Primary Zone"
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
},
"SecondaryZoneId": {
"Type": "String",
"Label": {
"zh-cn": "备可用区",
"en": "Secondary Zone"
},
"Description": {
"zh-cn": "备可用区ID,用于跨可用区容灾。建议选择与主可用区不同的可用区。",
"en": "Secondary zone ID for cross-zone disaster recovery."
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
},
"VpcId": {
"Type": "String",
"Label": {
"zh-cn": "VPC ID",
"en": "VPC ID"
},
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"VSwitchId": {
"Type": "String",
"Label": {
"zh-cn": "交换机ID",
"en": "VSwitch ID"
},
"AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}",
"ZoneId": "${ZoneId}"
}
},
"InstanceName": {
"Type": "String",
"Label": {
"zh-cn": "实例名称",
"en": "Instance Name"
},
"Default": "prod-redis-cluster"
},
"InstanceClass": {
"Type": "String",
"Label": {
"zh-cn": "实例规格",
"en": "Instance Class"
},
"Description": {
"zh-cn": "Redis集群版实例规格。例如:redis.shard.small.ce(1GB集群版),redis.shard.mid.ce(2GB集群版)。",
"en": "Redis cluster instance class, e.g. redis.shard.small.ce (1GB), redis.shard.mid.ce (2GB)."
},
"Default": "redis.shard.small.ce"
},
"Password": {
"Type": "String",
"Label": {
"zh-cn": "实例密码",
"en": "Instance Password"
},
"NoEcho": true,
"MinLength": 8,
"MaxLength": 32
},
"ShardCount": {
"Type": "Number",
"Label": {
"zh-cn": "分片数",
"en": "Shard Count"
},
"Description": {
"zh-cn": "集群版分片数量,取值范围2~32。",
"en": "Number of shards for the cluster, range 2-32."
},
"Default": 4,
"MinValue": 2,
"MaxValue": 32
},
"ReadOnlyCount": {
"Type": "Number",
"Label": {
"zh-cn": "只读节点数",
"en": "Read-Only Node Count"
},
"Description": {
"zh-cn": "每个分片的只读节点数量,用于读写分离。设为0则不启用。",
"en": "Number of read-only nodes per shard for read-write splitting. Set to 0 to disable."
},
"Default": 1,
"MinValue": 0,
"MaxValue": 5
},
"EvictionPolicy": {
"Type": "String",
"Label": {
"zh-cn": "数据逐出策略",
"en": "Eviction Policy"
},
"Description": {
"zh-cn": "内存不足时的数据逐出策略。noeviction:不删除,写操作返回错误。allkeys-lru:优先删除最近最少使用的key。volatile-lru:仅对设置了过期时间的key执行LRU淘汰。volatile-ttl:仅删除过期时间最短的key。",
"en": "Data eviction policy when memory is full."
},
"Default": "volatile-lru",
"AllowedValues": [
"noeviction",
"allkeys-lru",
"volatile-lru",
"allkeys-random",
"volatile-random",
"volatile-ttl"
]
},
"ResourceGroupId": {
"Type": "String",
"Label": {
"zh-cn": "资源组ID",
"en": "Resource Group ID"
},
"Description": {
"zh-cn": "实例所属的资源组ID。",
"en": "The resource group ID."
},
"AssociationProperty": "ALIYUN::ResourceManager::ResourceGroup",
"Default": ""
},
"Period": {
"Type": "Number",
"Label": {
"zh-cn": "购买时长(月)",
"en": "Period (Months)"
},
"Default": 6,
"AllowedValues": [1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36]
}
},
"Resources": {
"RedisCluster": {
"Type": "ALIYUN::REDIS::PrepayInstance",
"Properties": {
"InstanceName": {
"Ref": "InstanceName"
},
"InstanceClass": {
"Ref": "InstanceClass"
},
"EngineVersion": "5.0",
"NodeType": "MASTER_SLAVE",
"ProductType": "OnECS",
"Password": {
"Ref": "Password"
},
"VpcId": {
"Ref": "VpcId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"ZoneId": {
"Ref": "ZoneId"
},
"SecondaryZoneId": {
"Ref": "SecondaryZoneId"
},
"ShardCount": {
"Ref": "ShardCount"
},
"ReadOnlyCount": {
"Ref": "ReadOnlyCount"
},
"EvictionPolicy": {
"Ref": "EvictionPolicy"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"Period": {
"Ref": "Period"
},
"AutoPay": true,
"AutoRenewDuration": 1,
"DeletionProtection": true,
"DeletionForce": false,
"BackupPolicy": {
"PreferredBackupPeriod": "Monday,Wednesday,Friday,Sunday",
"PreferredBackupTime": "18:00Z-19:00Z",
"EnableBackupLog": 1
},
"Tags": [
{
"Key": "Environment",
"Value": "Production"
},
{
"Key": "Architecture",
"Value": "Cluster"
}
]
}
}
},
"Outputs": {
"InstanceId": {
"Label": {
"zh-cn": "实例ID",
"en": "Instance ID"
},
"Value": {
"Fn::GetAtt": [
"RedisCluster",
"InstanceId"
]
}
},
"ConnectionDomain": {
"Label": {
"zh-cn": "连接域名",
"en": "Connection Domain"
},
"Value": {
"Fn::GetAtt": [
"RedisCluster",
"ConnectionDomain"
]
}
},
"Port": {
"Label": {
"zh-cn": "连接端口",
"en": "Connection Port"
},
"Value": {
"Fn::GetAtt": [
"RedisCluster",
"Port"
]
}
},
"Capacity": {
"Label": {
"zh-cn": "存储容量",
"en": "Storage Capacity"
},
"Description": {
"zh-cn": "Redis实例的存储容量。",
"en": "The storage capacity of the Redis instance."
},
"Value": {
"Fn::GetAtt": [
"RedisCluster",
"Capacity"
]
}
},
"OrderId": {
"Label": {
"zh-cn": "订单ID",
"en": "Order ID"
},
"Description": {
"zh-cn": "预付费订单ID。",
"en": "The prepaid order ID."
},
"Value": {
"Fn::GetAtt": [
"RedisCluster",
"OrderId"
]
}
}
}
}