O recurso ALIYUN::REDIS::PrepayInstance cria uma instância Tair (Redis) com assinatura.
Sintaxe
{
"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
}
}
Propriedades
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
AutoPay |
Boolean |
Não |
Não |
Defina se o pagamento automático está ativado. |
Valores válidos:
|
|
AutoRenewDuration |
Integer |
Não |
Sim |
Período de renovação automática. |
Valores válidos: 1 a 12. Unidade: mês. A instância é renovada automaticamente por esse período antes do vencimento. |
|
BackupPolicy |
Map |
Não |
Sim |
Política de backup. |
Para mais informações, consulte BackupPolicy properties. |
|
Connections |
Map |
Não |
Sim |
Endpoints da instância. |
Para mais informações, consulte Connections properties. |
|
DeletionForce |
Boolean |
Não |
Sim |
Defina se a instância deve ser excluída imediatamente em vez de movida para a lixeira. |
Valores válidos:
|
|
DeletionProtection |
Boolean |
Não |
Sim |
Defina se a proteção contra exclusão está ativada. |
Valores válidos:
|
|
EngineVersion |
String |
Não |
Sim |
Versão do mecanismo de banco de dados. |
Valores válidos:
|
|
EvictionPolicy |
String |
Não |
Não |
Política de evicção. |
Valores válidos:
|
|
InstanceClass |
String |
Não |
Sim |
Especificação da instância. |
Para mais informações, consulte Instance Specifications Overview. |
|
InstanceMaintainTime |
Map |
Não |
Sim |
Janela de manutenção da instância. |
Para mais informações, consulte InstanceMaintainTime properties. |
|
InstanceName |
String |
Não |
Sim |
Nome da instância. |
Deve ter de 2 a 128 caracteres. Deve começar com uma letra ou caractere chinês. Pode conter letras, dígitos, caracteres chineses, sublinhados (_), hifens (-) e pontos (.). |
|
NodeType |
String |
Não |
Não |
Tipo de nó. |
Valores válidos:
Nota
Para instâncias da edição cloud-native, selecione |
|
Password |
String |
Não |
Sim |
Senha da instância. |
Deve ter de 8 a 32 caracteres e incluir caracteres de pelo menos três categorias: letras maiúsculas, letras minúsculas, dígitos e caracteres especiais. Caracteres especiais suportados: |
|
Period |
Integer |
Não |
Não |
Duração da assinatura. |
Valores válidos: 1 a 9, 12, 24 e 36. Unidade: mês. |
|
PeriodUnit |
String |
Não |
Não |
Unidade da duração da assinatura. |
Valores válidos:
|
|
ProductType |
String |
Não |
Não |
Tipo de product. |
Valores válidos:
|
|
ReadOnlyCount |
Integer |
Não |
Não |
Número de réplicas de leitura na zona de disponibilidade primária. |
Nota
O parâmetro ReadOnlyCount aplica-se apenas a instâncias da edição cloud-native com o recurso de divisão de leitura/escrita ativado. Se a instância usar a arquitetura de cluster, este parâmetro especifica o número de réplicas de leitura por shard. |
|
ResourceGroupId |
String |
Não |
Sim |
ID do grupo de recursos. |
Nenhuma |
|
SecondaryZoneId |
String |
Não |
Sim |
ID da zona de disponibilidade secundária. |
Chame a operação DescribeZones para consultar os IDs de zonas de disponibilidade suportados. Nota
Implante nós primários e secundários em zonas diferentes para recuperação de desastres entre zonas. |
|
SecurityGroupId |
String |
Não |
Sim |
ID do grupo de segurança. |
Até 10 IDs, separados por vírgulas (,). |
|
ShardCount |
Integer |
Não |
Não |
Número de shards. |
Valores válidos:
|
|
SSLEnabled |
String |
Não |
Sim |
Estado da criptografia ssl. |
Valores válidos:
|
|
SubscriptionDeletionForce |
Boolean |
Não |
Não |
Apenas para instâncias com assinatura. Defina como |
Nenhuma |
|
Tags |
List |
Não |
Sim |
Tags da instância. |
Máximo de 20 tags por instância. Para mais informações, consulte Tags properties. |
|
TairConfig |
Map |
Não |
Não |
Configuração do Tair. |
Para mais informações, consulte TairConfig properties. |
|
TLSProtocol |
String |
Não |
Não |
Versão TLS da instância. |
Valores válidos:
|
|
VpcId |
String |
Não |
Não |
ID da VPC. |
Nenhuma |
|
VpcPasswordFree |
Boolean |
Não |
Não |
Defina se o acesso sem senha dentro da VPC está ativado. |
Valores válidos:
|
|
VSwitchId |
String |
Não |
Não |
ID do vSwitch. |
Nenhuma |
|
ZoneId |
String |
Não |
Não |
ID da zona de disponibilidade. |
Este parâmetro é obrigatório para instâncias em uma VPC. Para implantar uma instância em várias zonas de disponibilidade, use a operação DescribeZones para encontrar os IDs de zona suportados. |
Sintaxe de BackupPolicy
"BackupPolicy": {
"PreferredBackupPeriod": "String",
"PreferredBackupTime": "String",
"EnableBackupLog": "Integer"
}
Propriedades de BackupPolicy
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
PreferredBackupPeriod |
String |
Sim |
Sim |
Dia da semana para backup. |
Valores válidos:
|
|
PreferredBackupTime |
String |
Sim |
Sim |
Janela de horário de backup em UTC. |
Formato: |
|
EnableBackupLog |
Integer |
Não |
Sim |
Defina se o backup incremental está ativado. |
Valores válidos:
|
Sintaxe de InstanceMaintainTime
"InstanceMaintainTime": {
"MaintainStartTime": "String",
"MaintainEndTime": "String"
}
Propriedades de InstanceMaintainTime
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
MaintainEndTime |
String |
Não |
Não |
Horário de término da janela de manutenção. |
Formato: Nota
O horário de término deve ser exatamente uma hora após o horário de início. Por exemplo, se MaintainStartTime for |
|
MaintainStartTime |
String |
Não |
Não |
Horário de início da janela de manutenção. |
Formato: |
Sintaxe de Tags
"Tags": [
{
"Key": String,
"Value": String
}
]
Propriedades de Tags
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
Key |
String |
Sim |
Não |
Chave da tag. |
A chave da tag deve ser exclusiva dentro de uma conta e região. |
|
Value |
String |
Não |
Não |
Valor da tag. |
Nenhuma |
Sintaxe de Connections
"Connections": {
"VpcPrivateConnection": "Map",
"ClassicInnerConnection": "Map",
"DirectConnection": "Map",
"PublicConnection": "Map"
}
Propriedades de Connections
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
ClassicInnerConnection |
Map |
Não |
Sim |
Endpoint da rede clássica. |
Para mais informações, consulte ClassicInnerConnection properties. |
|
DirectConnection |
Map |
Não |
Sim |
Endpoint de conexão direta. |
Para mais informações, consulte DirectConnection properties. |
|
PublicConnection |
Map |
Não |
Sim |
Endpoint público. |
Para mais informações, consulte PublicConnection properties. |
|
VpcPrivateConnection |
Map |
Não |
Sim |
Endpoint da VPC. |
Para mais informações, consulte VpcPrivateConnection properties. |
Sintaxe de VpcPrivateConnection
"VpcPrivateConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
Propriedades de VpcPrivateConnection
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
ConnectionPort |
Integer |
Sim |
Sim |
Número da porta para o service ApsaraDB na instância. |
Valores válidos: 1024 a 65535. |
|
ConnectionString |
String |
Não |
Sim |
Prefixo do endpoint da VPC. |
O prefixo deve ter de 8 a 64 caracteres, começar com uma letra minúscula e conter apenas letras minúsculas e dígitos. |
Sintaxe de PublicConnection
"PublicConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
Propriedades de PublicConnection
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
ConnectionPort |
Integer |
Sim |
Sim |
Porta de service da instância ApsaraDB. |
Valores válidos: 1024 a 65535. |
|
ConnectionString |
String |
Não |
Sim |
Prefixo do endpoint público. |
Deve ter de 8 a 64 caracteres, começar com uma letra minúscula e conter apenas letras minúsculas e dígitos. |
Sintaxe de DirectConnection
"DirectConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
Propriedades de DirectConnection
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
ConnectionPort |
Integer |
Sim |
Sim |
Porta de service da instância ApsaraDB. |
Valores válidos: 1024 a 65535. |
|
ConnectionString |
String |
Não |
Sim |
Prefixo do endpoint privado. |
O prefixo deve ter de 8 a 64 caracteres, começar com uma letra minúscula e conter apenas letras minúsculas e dígitos. |
Sintaxe de ClassicInnerConnection
"ClassicInnerConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
Propriedades de ClassicInnerConnection
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
ConnectionPort |
Integer |
Sim |
Sim |
Porta de service da instância ApsaraDB. |
Valores válidos: 1024 a 65535. |
|
ConnectionString |
String |
Não |
Sim |
Prefixo do endpoint da rede clássica. |
O prefixo deve ter de 8 a 64 caracteres, começar com uma letra minúscula e conter apenas letras minúsculas e dígitos. |
Sintaxe de TairConfig
"BackupPolicy": {
"Storage": "Integer",
"StorageType": "String",
"ShardCount": "Integer"
}
Propriedades de TairConfig
|
Propriedade |
Tipo |
Obrigatório |
Editável |
Descrição |
Restrições |
|
ShardCount |
Integer |
Não |
Não |
Número de shards de dados. |
Valores válidos:
|
|
Storage |
Integer |
Não |
Não |
Capacidade de armazenamento do disco em nuvem. |
Varia conforme a especificação da instância. Para mais informações, consulte ESSD/SSD-based instances. |
|
StorageType |
String |
Não |
Não |
Tipo de armazenamento. |
Valores válidos:
|
Valores de retorno
Fn::GetAtt
InstanceId: ID da instância.
OrderId: ID do pedido.
ConnectionDomain: endpoint usado para acessar a instância.
Port: porta usada para conectar à instância.
InstanceName: nome da instância.
InstanceClass: especificações da instância.
VpcId: ID da VPC.
Capacity: capacidade de armazenamento da instância.
InstanceType: tipo de mecanismo da instância.
ChargeType: método de faturamento da instância.
PackageType: tipo de plano.
Connections: número máximo de conexões suportadas pela instância.
ArchitectureType: tipo de arquitetura da instância.
NodeType: tipo de nó da instância.
HasRenewChangeOrder: indica se a conta possui um pedido pendente de renovação ou dimensionamento.
ResourceGroupId: ID do grupo de recursos.
QPS: consultas teóricas por segundo (QPS) da instância.
ZoneId: ID da zona da instância.
Bandwidth: largura de banda da instância. Unidade: Mbps.
EngineVersion: versão do mecanismo da instância.
NetworkType: tipo de rede da instância.
VSwitchId: ID do vSwitch.
PrivateIp: endereço IP privado da instância.
PublicConnectionString: string de conexão pública da instância.
VpcPrivateConnectionPort: porta usada para conexão privada à instância dentro de uma VPC.
ClassicInnerConnectionString: string de conexão interna da instância via rede clássica.
VpcPrivateConnectionString: string de conexão privada da VPC da instância.
PublicConnectionPort: porta usada para conexão pública à instância.
DirectConnectionString: string de conexão direta da instância.
DirectConnectionPort: porta usada para conexão direta à instância.
ClassicInnerConnectionPort: porta usada para conexão interna à instância via rede clássica.
Exemplos
Cenário 1: Crie uma instância Redis standard edition com assinatura implantada em uma rede 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"
]
}
}
}
}Cenário 2: Crie uma instância Redis com assinatura com política de backup, janela de manutenção, ssl e tags.
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"
]
}
}
}
}Cenário 3: Crie uma instância Redis cluster edition com assinatura com recuperação de desastres entre zonas, divisão de leitura/escrita e grupo de recursos.
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"
]
}
}
}
}