ALIYUN::REDIS::PrepayInstance類型用於建立預付費Redis執行個體。
文法
{
"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,
"TLSProtocol": String,
"Connections": Map,
"AutoRenewDuration": Integer,
"ProductType": String,
"SecondaryZoneId": String,
"ResourceGroupId": String,
"PeriodUnit": String,
"TairConfig": Map,
"ShardCount": Integer,
"ReadOnlyCount": Integer,
"SubscriptionDeletionForce": Boolean,
"NodeType": String,
"DeletionProtection": Boolean
}
}
屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
AutoPay |
Boolean |
否 |
否 |
是否自動付費。 |
取值:
|
|
AutoRenewDuration |
Integer |
否 |
是 |
自動續約時間長度。 |
取值範圍:1~12。 單位:月。 當執行個體即將到期時,將根據該參數指定的時間長度自動續約。 |
|
BackupPolicy |
Map |
否 |
是 |
備份策略。 |
更多資訊,請參見BackupPolicy屬性。 |
|
Connections |
Map |
否 |
是 |
串連地址。 |
更多資訊,請參見Connections屬性。 |
|
DeletionForce |
Boolean |
否 |
是 |
是否在回收時刪除執行個體。 |
取值:
|
|
DeletionProtection |
Boolean |
否 |
是 |
是否已開啟釋放保護功能。 |
取值:
|
|
EngineVersion |
String |
否 |
是 |
資料庫版本。 |
取值:
|
|
EvictionPolicy |
String |
否 |
否 |
資料逐出策略。 |
取值:
|
|
InstanceClass |
String |
否 |
是 |
執行個體規格。 |
更多資訊,請參見執行個體規格概覽。 |
|
InstanceMaintainTime |
Map |
否 |
是 |
執行個體的可維護時間段。 |
更多資訊,請參見InstanceMaintainTime屬性。 |
|
InstanceName |
String |
否 |
是 |
執行個體名稱。 |
長度為2~128個字元。必須以英文字母或漢字開頭,可包含英文字母、數字、漢字、底線(_)、短劃線(-)和半形句號(.)。 |
|
NodeType |
String |
否 |
否 |
節點類型。 |
取值:
說明
雲原生版執行個體請選擇MASTER_SLAVE或STAND_ALONE,經典版執行個體請選擇double或single。 |
|
Password |
String |
否 |
是 |
執行個體密碼。 |
長度為8~32個字元。必須包含大寫英文字母、小寫英文字母、數字和特殊字元中至少三種。支援特殊字元為: |
|
Period |
Integer |
否 |
否 |
預付費續約時間長度。 |
取值:1~9、12、24、36。 單位:月。 |
|
PeriodUnit |
String |
否 |
否 |
時間長度單位。 |
取值:
|
|
ProductType |
String |
否 |
否 |
產品類型。 |
取值:
|
|
ReadOnlyCount |
Integer |
否 |
否 |
主可用性區域的唯讀節點數。 |
說明
ReadOnlyCount 參數僅適用於雲原生版、開啟讀寫分離的執行個體。如果執行個體為叢集架構,則上述參數分別表示單分區的(主、備可用性區域)唯讀節點數量。 |
|
ResourceGroupId |
String |
否 |
是 |
資源群組ID。 |
無 |
|
SecondaryZoneId |
String |
否 |
是 |
備可用性區域ID。 |
可調用查詢支援的可用性區域介面查詢。 說明
傳入本參數可以實現主備資料節點分布在不同的可用性區域,實現跨可用性區域容災,能夠承受機房層級的故障。 |
|
SecurityGroupId |
String |
否 |
是 |
安全性群組ID。 |
最多支援設定10個ID,ID之間用半形逗號(,)分隔。 |
|
ShardCount |
Integer |
否 |
否 |
分區數。 |
有效值:
|
|
SSLEnabled |
String |
否 |
是 |
SSL狀態。 |
取值:
|
|
SubscriptionDeletionForce |
Boolean |
否 |
否 |
該選項僅適用於訂用帳戶執行個體。對於訂用帳戶執行個體,如果此選項為 true,則在刪除之前會將執行個體轉換為隨用隨付執行個體;如果為 false,則不會執行強制移除。此操作會產生額外費用,請謹慎選擇。 |
無 |
|
Tags |
List |
否 |
是 |
標籤。 |
每個執行個體最多可以綁定20個標籤。 更多資訊,請參見Tags屬性。 |
|
TairConfig |
Map |
否 |
否 |
Tair配置。 |
更多資訊,請參見TairConfig屬性。 |
|
TLSProtocol |
String |
否 |
否 |
該執行個體的 TLS 版本。 |
取值:
|
|
VpcId |
String |
否 |
否 |
專用網路ID。 |
無 |
|
VpcPasswordFree |
Boolean |
否 |
否 |
是否啟用免密碼訪問專用網路中的執行個體。 |
取值:
|
|
VSwitchId |
String |
否 |
否 |
交換器ID。 |
無 |
|
ZoneId |
String |
否 |
否 |
可用性區域ID。 |
當建立的執行個體屬於專用網路時,該參數必須指定。 建立多可用性區域執行個體時,調用查詢支援的可用性區域介面查詢支援的多可用性區域ID。 |
BackupPolicy文法
"BackupPolicy": {
"PreferredBackupPeriod": "String",
"PreferredBackupTime": "String",
"EnableBackupLog": "Integer"
}
BackupPolicy屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
PreferredBackupPeriod |
String |
是 |
是 |
備份周期。 |
取值:
|
|
PreferredBackupTime |
String |
是 |
是 |
備份時間。 |
格式: |
|
EnableBackupLog |
Integer |
否 |
是 |
開啟或關閉增量備份。 |
取值:
|
InstanceMaintainTime文法
"InstanceMaintainTime": {
"MaintainStartTime": "String",
"MaintainEndTime": "String"
}
InstanceMaintainTime屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
MaintainEndTime |
String |
否 |
否 |
可維護時間段的結束時間。 |
格式: 說明
開始時間和結束時間的間隔應為1小時,例如:MaintainStartTime為 |
|
MaintainStartTime |
String |
否 |
否 |
可維護時間段的開始時間。 |
格式: |
Tags文法
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
Key |
String |
是 |
否 |
標籤鍵。 |
在同帳號、同地區下,標籤鍵唯一。 |
|
Value |
String |
否 |
否 |
標籤值。 |
無 |
Connections文法
"Connections": {
"VpcPrivateConnection": "Map",
"ClassicInnerConnection": "Map",
"DirectConnection": "Map",
"PublicConnection": "Map"
}
Connections屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
ClassicInnerConnection |
Map |
否 |
是 |
經典內網地址。 |
更多資訊,請參見ClassicInnerConnection屬性。 |
|
DirectConnection |
Map |
否 |
是 |
直接連接地址。您可以根據需要申請直連端點。 |
更多資訊,請參見DirectConnection屬性。 |
|
PublicConnection |
Map |
否 |
是 |
公用地址。 |
更多資訊,請參見PublicConnection屬性。 |
|
VpcPrivateConnection |
Map |
否 |
是 |
VPC內網地址。 |
更多資訊,請參見VpcPrivateConnection屬性。 |
VpcPrivateConnection文法
"VpcPrivateConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
VpcPrivateConnection屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
ConnectionPort |
Integer |
是 |
是 |
執行個體的ApsaraDB服務連接埠號碼。 |
取值範圍:1024~65535。 |
|
ConnectionString |
String |
否 |
是 |
公用端點的首碼。 |
長度為8~64個字元,必須以小寫英文字母開頭。可包含小寫英文字母和數字。 |
PublicConnection文法
"PublicConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
PublicConnection屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
ConnectionPort |
Integer |
是 |
是 |
執行個體的ApsaraDB服務連接埠號碼。 |
取值範圍:1024~65535。 |
|
ConnectionString |
String |
否 |
是 |
公用端點的首碼。 |
長度為8~64個字元,必須以小寫英文字母開頭。可包含小寫英文字母和數字。 |
DirectConnection文法
"DirectConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
DirectConnection屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
ConnectionPort |
Integer |
是 |
是 |
執行個體的ApsaraDB服務連接埠號碼。 |
取值範圍:1024~65535。 |
|
ConnectionString |
String |
否 |
是 |
公用端點的首碼。 |
長度為8~64個字元,必須以小寫英文字母開頭。可包含小寫英文字母和數字。 |
ClassicInnerConnection文法
"ClassicInnerConnection": {
"ConnectionPort": Integer,
"ConnectionString": String
}
ClassicInnerConnection屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
ConnectionPort |
Integer |
是 |
是 |
執行個體的ApsaraDB服務連接埠號碼。 |
取值範圍:1024~65535。 |
|
ConnectionString |
String |
否 |
是 |
公用端點的首碼。 |
長度為8~64個字元,必須以小寫英文字母開頭。可包含小寫英文字母和數字。 |
TairConfig文法
"BackupPolicy": {
"Storage": "Integer",
"StorageType": "String",
"ShardCount": "Integer"
}
TairConfig屬性
|
屬性名稱 |
類型 |
必須 |
允許更新 |
描述 |
約束 |
|
ShardCount |
Integer |
否 |
否 |
執行個體中的資料節點個數。 |
取值:
|
|
Storage |
Integer |
否 |
否 |
雲端硬碟的儲存空間。 |
不同的規格取值範圍有所區別。更多資訊,請參見磁碟型執行個體規格。 |
|
StorageType |
String |
否 |
否 |
儲存類型。 |
取值:
|
傳回值
Fn::GetAtt
-
InstanceId:執行個體ID。
-
OrderId:訂單ID。
-
ConnectionDomain:執行個體的串連網域名稱。
-
Port:執行個體的串連連接埠。
-
InstanceName:執行個體名稱。
-
InstanceClass:執行個體規格。
-
VpcId:專用網路ID。
-
Capacity:執行個體的儲存容量。
-
InstanceType:執行個體的引擎版本。
-
ChargeType:執行個體的計費方式。
-
PackageType:計劃類型。
-
Connections:執行個體支援的最大串連數。
-
ArchitectureType:架構類型。
-
NodeType:節點類型。
-
HasRenewChangeOrder:阿里雲帳號是否有待續訂或擴容訂單。
-
ResourceGroupId:資源群組ID。
-
QPS:每秒訪問次數,取值為當前規格執行個體的理論值。
-
ZoneId:執行個體所屬的可用性區域ID。
-
Bandwidth:執行個體頻寬。單位:Mbps。
-
EngineVersion:版本類型。
-
NetworkType:網路類型。
-
VSwitchId:交換器ID。
-
PrivateIp:執行個體的私網IP地址。
-
PublicConnectionString:執行個體的公用連接字串。
-
VpcPrivateConnectionPort:VPC私人串連連接埠。
-
ClassicInnerConnectionString:執行個體的經典內部連接字串。
-
VpcPrivateConnectionString:執行個體的VPC私人連接字串。
-
PublicConnectionPort:執行個體的公用串連連接埠。
-
DirectConnectionString:執行個體的直接連接字串。
-
DirectConnectionPort:執行個體的直接連接連接埠。
-
ClassicInnerConnectionPort:執行個體的經典內串連連接埠。
樣本
情境 1 :建立訂用帳戶Redis標準版執行個體,部署在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"
]
}
}
}
}情境 2 :建立訂用帳戶Redis執行個體,配置備份策略、維護視窗、SSL和標籤。
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"
]
}
}
}
}情境 3 :建立訂用帳戶Redis叢集版執行個體,配置跨可用性區域容災、讀寫分離和資源群組。
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"
]
}
}
}
}