Tipe resource ALIYUN::REDIS::Whitelist digunakan untuk menetapkan daftar putih IP pada instans Redis.
Sintaksis
{
"Type": "ALIYUN::REDIS::Whitelist",
"Properties": {
"InstanceId": String,
"SecurityIpGroupName": String,
"SecurityIpGroupAttribute": String,
"SecurityIps": String
}
}Properti
Nama Properti | Tipe | Wajib | Dapat Diperbarui | Deskripsi | Batasan |
InstanceId | String | Ya | Tidak | ID instans Redis (unik secara global). | Tidak ada |
SecurityIpGroupName | String | Tidak | Tidak | Nama kelompok daftar putih. Nilai default: default. | Tidak ada |
SecurityIpGroupAttribute | String | Tidak | Tidak | Nilai atribut kelompok daftar putih. Default kosong. Konsol tidak menampilkan kelompok daftar putih dengan nilai hidden. | Tidak ada |
SecurityIps | String | Ya | Ya | Daftar IP dalam kelompok daftar putih IP. Pisahkan alamat IP dengan koma Inggris. Format: 0.0.0.0/0,10.23.12.24, atau 10.23.12.24/24 (mode CIDR, Classless Inter-Domain Routing. /24 menunjukkan panjang awalan dalam alamat, berkisar antara 1 hingga 32). | Maksimum 1000 |
Nilai yang Dikembalikan
Fn::GetAtt
SecurityIpGroupName: Nama kelompok daftar putih
SecurityIpGroupAttribute: Nilai atribut kelompok daftar putih
SecurityIps: Daftar putih alamat IP
Contoh
Skenario 1: Tambahkan daftar putih IP untuk Redis.
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
InstanceId:
Type: String
Description: ID instans Redis (unik secara global)
AssociationProperty: ALIYUN::Redis::Instance::InstanceId
Resources:
Whitelist:
Type: ALIYUN::REDIS::Whitelist
Properties:
InstanceId:
Ref: InstanceId
SecurityIpGroupName: ros
SecurityIpGroupAttribute: show
SecurityIps: 0.0.0.0/0
Outputs:
SecurityIpGroupName:
Description: Nama kelompok daftar putih
Value:
Fn::GetAtt:
- Whitelist
- SecurityIpGroupName
SecurityIpGroupAttribute:
Description: Nilai atribut kelompok daftar putih
Value:
Fn::GetAtt:
- Whitelist
- SecurityIpGroupAttribute
SecurityIps:
Description: Daftar putih alamat IP
Value:
Fn::GetAtt:
- Whitelist
- SecurityIps
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"InstanceId": {
"Type": "String",
"Description": "ID instans Redis (unik secara global)",
"AssociationProperty": "ALIYUN::Redis::Instance::InstanceId"
}
},
"Resources": {
"Whitelist": {
"Type": "ALIYUN::REDIS::Whitelist",
"Properties": {
"InstanceId": {
"Ref": "InstanceId"
},
"SecurityIpGroupName": "ros",
"SecurityIpGroupAttribute": "show",
"SecurityIps": "0.0.0.0/0"
}
}
},
"Outputs": {
"SecurityIpGroupName": {
"Description": "Nama kelompok daftar putih",
"Value": {
"Fn::GetAtt": [
"Whitelist",
"SecurityIpGroupName"
]
}
},
"SecurityIpGroupAttribute": {
"Description": "Nilai atribut kelompok daftar putih",
"Value": {
"Fn::GetAtt": [
"Whitelist",
"SecurityIpGroupAttribute"
]
}
},
"SecurityIps": {
"Description": "Daftar putih alamat IP",
"Value": {
"Fn::GetAtt": [
"Whitelist",
"SecurityIps"
]
}
}
}
}Skenario 2: Buat instans Redis dan tambahkan daftar putih IP.
ROSTemplateFormatVersion: '2015-09-01'
Description: {}
Parameters:
VpcId:
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
ZoneId:
Type: String
Description: Sebelum membuat instans, pastikan Zona Ketersediaan mendukung spesifikasi resource Redis.
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
Label: Zone ID
VSwitchId:
Type: String
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
Resources:
RedisInstance:
Type: ALIYUN::REDIS::Instance
Properties:
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
InstanceClass: redis.master.small.default
EvictionPolicy: noeviction
ZoneId:
Ref: ZoneId
InstanceName: DefaultRedis
Password: Admin@123!
REDISWhitelist:
Type: ALIYUN::REDIS::Whitelist
Properties:
InstanceId:
Ref: RedisInstance
SecurityIps: 192.168.0.0/16
Outputs:
InstanceId:
Value:
Fn::GetAtt:
- RedisInstance
- InstanceId {
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {},
"Parameters": {
"VpcId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"ZoneId": {
"Type": "String",
"Description": {
"zh-cn": "Sebelum membuat instans, pastikan zona mendukung spesifikasi resource Redis.",
"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",
"zh-cn": "Zone"
}
},
"VSwitchId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}",
"ZoneId": "${ZoneId}"
}
}
},
"Resources": {
"RedisInstance": {
"Type": "ALIYUN::REDIS::Instance",
"Properties": {
"VpcId": {
"Ref": "VpcId"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"InstanceClass": "redis.master.small.default",
"EvictionPolicy": "noeviction",
"ZoneId": {
"Ref": "ZoneId"
},
"InstanceName": "DefaultRedis",
"Password": "Admin@123!"
}
},
"REDISWhitelist": {
"Type": "ALIYUN::REDIS::Whitelist",
"Properties": {
"InstanceId": {
"Ref": "RedisInstance"
},
"SecurityIps": "192.168.0.0/16"
}
}
},
"Outputs": {
"InstanceId": {
"Value": {
"Fn::GetAtt": [
"RedisInstance",
"InstanceId"
]
}
}
}
}Skenario 3: Capai sinkronisasi cache antara MySQL dan Redis menggunakan DTS.
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: Templat ini mencapai sinkronisasi cache antara MySQL dan Redis melalui DTS, mencakup pembuatan dan konfigurasi keamanan instans VPC, ECS, RDS, dan Redis, serta pembentukan kelompok konsumen untuk memastikan konsistensi data.
en: This template achieves cache synchronization between MySQL and Redis via DTS, encompassing the creation and security configuration of VPC, ECS, RDS, and Redis instances, alongside the establishment of consumer groups to ensure data consistency.
Parameters:
ZoneId:
Type: String
Label:
en: VSwitch Availability Zone
zh-cn: VSwitch Availability Zone
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
RDSDBUser:
Type: String
Label:
en: RDS DB Username
zh-cn: RDS DB Username
Description:
en: Username of database.
zh-cn: Username of database.
ConstraintDescription:
en: Consist of 2 to 16 characters of lowercase letters and underscores. Must begin with a letter and end with an alphanumeric character.
zh-cn: Consist of 2 to 16 characters of lowercase letters and underscores. Must begin with a letter and end with an alphanumeric character.
Default: demouser123
MinLength: 2
MaxLength: 16
DbName:
Type: String
Label:
en: RDS DB Name
zh-cn: RDS DB Name
ConstraintDescription:
en: Consist of 2 to 16 characters of lowercase letters and underscores. Must begin with a letter and end with an alphanumeric character.
zh-cn: Consist of 2 to 16 characters of lowercase letters and underscores. Must begin with a letter and end with an alphanumeric character.
Default: demodb
Required: true
MinLength: 2
MaxLength: 16
RDSDBPassword:
Type: String
Label:
en: RDS DB Password
zh-cn: RDS DB Password
Description:
en: 'RDS database password, consisting of letters, numbers, and underscores (_), is 8 to 32 characters long. Must contain three different types of characters.'
zh-cn: 'RDS database password, consisting of letters, numbers, and underscores (_), is 8 to 32 characters long. Must contain three different types of characters.'
ConstraintDescription:
en: 'Consisting of letters, numbers, and underscores (_), is 8 to 32 characters long.'
zh-cn: 'Consisting of letters, numbers, and underscores (_), is 8 to 32 characters long.'
AssociationProperty: ALIYUN::RDS::Instance::AccountPassword
MinLength: 8
MaxLength: 32
NoEcho: true
DBInstanceClass:
Type: String
Label:
en: Instance Class
zh-cn: Instance Class
AssociationProperty: ALIYUN::RDS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ${ZoneId}
EngineVersion: "8.0"
Engine: MySQL
Category: HighAvailability
DBInstanceStorageType: cloud_essd
CommodityCode: bards
Default: mysql.x4.medium.2c
DtsJobName:
Type: String
Label:
en: DTS Job Name
zh-cn: DTS Job Name
Description:
en: You are advised to configure a name with service significance (without unique requirement) for easy identification.
zh-cn: You are advised to configure a name with service significance (without unique requirement) for easy identification.
Default: mysql2redis_dts
RedisInstanceClass:
Type: String
Label:
en: Tair Specifications
zh-cn: Tair Specifications
Description:
en: <font color='blue'>Before selecting a model, please confirm whether the model is in stock in the current availability zone. To save testing costs, it is recommended to use a model with 2 GB memory, for example: tair.rdb.2g</font>, see detail:<a href='https://www.alibabacloud.com/help/zh/redis/product-overview/enhanced-performance' target='_blank'><font color='red'>Specification inquiry</font></a>.
zh-cn: <font color='blue'>Before selecting a model, please confirm whether the model is in stock in the current availability zone. To save testing costs, it is recommended to use a model with 2 GB memory, for example: tair.rdb.2g</font>, see detail:<a href='https://www.alibabacloud.com/help/zh/redis/product-overview/enhanced-performance' target='_blank'><font color='red'>Specification inquiry</font></a>.
AssociationProperty: ALIYUN::REDIS::Instance::InstanceClass
AssociationPropertyMetadata:
Engine: Redis
ProductType: Tair_rdb
InstanceChargeType: PostPaid
ZoneId: ${ZoneId1}
OrderType: BUY
Default: tair.rdb.2g
RedisPassword:
Type: String
Label:
en: Instance Password
zh-cn: Instance Password
Description:
en: 'Length 8 to 32 characters. Can contain uppercase and lowercase letters, numbers, and special symbols, including the following: ! @ # $ % ^ & * ( ) _ + - ='
zh-cn: 'Length 8 to 32 characters. Can contain uppercase and lowercase letters, numbers, and special symbols, including the following: ! @ # $ % ^ & * ( ) _ + - ='
ConstraintDescription:
en: '8 to 32 characters. Can contain uppercase and lowercase letters, numbers, and special symbols, including the following: ! @ # $ % ^ & * ( ) _ + - ='
zh-cn: '8 to 32 characters. Can contain uppercase and lowercase letters, numbers, and special symbols, including the following: ! @ # $ % ^ & * ( ) _ + - ='
MinLength: '8'
MaxLength: '32'
NoEcho: true
Resources:
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchName:
Fn::Join:
- '-'
- - VSwitch
- StackId
- Ref: ALIYUN::StackId
CidrBlock: 192.168.0.0/24
RdsDBInstance:
Type: ALIYUN::RDS::DBInstance
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
DBInstanceClass:
Ref: DBInstanceClass
DBInstanceStorage: 100
Engine: MySQL
EngineVersion: "8.0"
MasterUserPassword:
Ref: RDSDBPassword
MasterUserType: Super
MasterUsername:
Ref: RDSDBUser
DBMappings:
- CharacterSetName: utf8mb4
DBName:
Ref: DbName
Category: HighAvailability
DBInstanceStorageType: cloud_essd
SecurityIPList: 192.168.0.0/16
SlaveZoneIds:
- Ref: ZoneId
RedisInstance:
Type: ALIYUN::REDIS::Instance
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
InstanceClass:
Ref: RedisInstanceClass
InstanceName: rds_mysql2redis_redis
EvictionPolicy: noeviction
EngineVersion: '6.0'
Password:
Ref: RedisPassword
Whitelist:
Type: ALIYUN::REDIS::Whitelist
Properties:
InstanceId:
Ref: RedisInstance
SecurityIps: 192.168.0.0/16
MigrationJob:
Type: ALIYUN::DTS::SynchronizationJob2
Properties:
DtsJobName:
Ref: DtsJobName
SourceEndpoint:
InstanceType: RDS
InstanceID:
Ref: RdsDBInstance
EngineName: MYSQL
Region:
Ref: ALIYUN::Region
UserName:
Ref: RDSDBUser
Password:
Ref: RDSDBPassword
DestinationEndpoint:
InstanceType: Redis
InstanceID:
Ref: RedisInstance
EngineName: Redis
Region:
Ref: ALIYUN::Region
Password:
Ref: RedisPassword
StructureInitialization: false
DelayNotice: true
ErrorNotice: true
DelayRuleTime: 60
DataInitialization: true
DataSynchronization: true
DbList:
Fn::GetJsonValue:
- DbList
- Fn::Sub: '{ "DbList": { "${DbName}": { "name": "0", "all": true, "customAttachedColumn": { "__DTS_TP_TO_REDIS_KEY__": { "name": "__DTS_TP_TO_REDIS_KEY__", "syntacticType": "ADD", "value": "__DB__+''.''+__TB__+''.''+pk_str_with_name_value(''.'',''.'')", "type": "STRING", "length": "" }, "__DTS_TP_TO_REDIS_VALUE__": { "name": "__DTS_TP_TO_REDIS_VALUE__", "syntacticType": "ADD", "value": "tp2redis_json_value()", "type": "STRING", "length": "" } } }}}'
DtsInstance:
Type: ALIYUN::DTS::Instance
Properties:
JobId:
Fn::GetAtt:
- MigrationJob
- DtsJobId
InstanceClass: small
PayType: PostPaid
AutoStart: true
Type: SYNC
SourceRegion:
Ref: ALIYUN::Region
DestinationRegion:
Ref: ALIYUN::Region
SourceEndpointEngineName: MySQL
DestinationEndpointEngineName: Redis
Outputs:
RdsInstanceAddress:
Description:
en: RDS Instance Address.
zh-cn: RDS Instance Address.
Value:
'Fn::Sub':
- 'https://rds.console.alibabacloud.com/detail/${InstanceID}/basicInfo?region=${Region}'
- InstanceID:
Ref: RdsDBInstance
Region:
Ref: ALIYUN::Region
TairInstanceAddress:
Description:
en: Tair Instance Address.
zh-cn: Tair Instance Address.
Value:
'Fn::Sub':
- 'https://kvstore.console.alibabacloud.com/Redis/instance/${Region}/${InstanceID}'
- InstanceID:
Ref: RedisInstance
Region:
Ref: ALIYUN::Region
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- ZoneId
Label:
default:
en: Infrastructure Configuration
zh-cn: Infrastructure Configuration
- Parameters:
- DBInstanceClass
- DbName
- RDSDBUser
- RDSDBPassword
Label:
default: RDS
- Parameters:
- RedisInstanceClass
- RedisPassword
Label:
default: Tair
- Parameters:
- DtsJobName
Label:
default: DTS
TemplateTags:
- acs:technical-solution:database:Real-time Synchronization of RDS and Redis to Build Cache Consistency-tech_solu_21
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "Templat ini menggunakan DTS untuk mencapai sinkronisasi cache antara MySQL dan Redis. Ini mencakup pembuatan dan konfigurasi keamanan instans VPC, ECS, RDS, dan Redis, serta menyiapkan kelompok konsumen untuk memastikan konsistensi data.",
"en": "This template achieves cache synchronization between MySQL and Redis via DTS, encompassing the creation and security configuration of VPC, ECS, RDS, and Redis instances, alongside the establishment of consumer groups to ensure data consistency."
},
"Parameters": {
"ZoneId": {
"Type": "String",
"Label": {
"en": "VSwitch Availability Zone",
"zh-cn": "Zona ketersediaan VSwitch"
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
},
"RDSDBUser": {
"Type": "String",
"Label": {
"en": "RDS DB Username",
"zh-cn": "akun database RDS"
},
"Description": {
"en": "Username of database.",
"zh-cn": "Username akun database."
},
"ConstraintDescription": {
"en": "Consist of 2 to 16 characters of lowercase letters, underline. Must begin with a letter and be end with an alphanumeric character.",
"zh-cn": "Terdiri dari 2 hingga 16 huruf kecil dan garis bawah (_). Harus dimulai dengan huruf dan diakhiri dengan karakter alfanumerik."
},
"Default": "demouser123",
"MinLength": 2,
"MaxLength": 16
},
"DbName": {
"Type": "String",
"Label": {
"en": "RDS DB Name",
"zh-cn": "Nama database RDS"
},
"ConstraintDescription": {
"en": "Consist of 2 to 16 characters of lowercase letters, underline. Must begin with a letter and be end with an alphanumeric character.",
"zh-cn": "Terdiri dari 2 hingga 16 huruf kecil dan garis bawah (_). Harus dimulai dengan huruf dan diakhiri dengan karakter alfanumerik."
},
"Default": "demodb",
"Required": true,
"MinLength": 2,
"MaxLength": 16
},
"RDSDBPassword": {
"Type": "String",
"Label": {
"en": "RDS DB Password",
"zh-cn": "Kata sandi database RDS"
},
"Description": {
"en": "RDS database password, consisting of letters, numbers, and underline(_), is 8 to 32 characters long,Must contain three different types of characters.",
"zh-cn": "Kata sandi untuk database RDS. Panjangnya harus 8 hingga 32 karakter, terdiri dari huruf, angka, dan garis bawah (_), serta mengandung tiga jenis karakter berbeda."
},
"ConstraintDescription": {
"en": "Consisting of letters, numbers, and underline(_), is 8 to 32 characters long.",
"zh-cn": "Kata sandi harus terdiri dari huruf, angka, dan garis bawah (_), serta memiliki panjang 8 hingga 32 karakter."
},
"AssociationProperty": "ALIYUN::RDS::Instance::AccountPassword",
"MinLength": 8,
"MaxLength": 32,
"NoEcho": true
},
"DBInstanceClass": {
"Type": "String",
"Label": {
"en": "Instance Class",
"zh-cn": "Tipe instans"
},
"AssociationProperty": "ALIYUN::RDS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"ZoneId": "${ZoneId}",
"EngineVersion": "8.0",
"Engine": "MySQL",
"Category": "HighAvailability",
"DBInstanceStorageType": "cloud_essd",
"CommodityCode": "bards"
},
"Default": "mysql.x4.medium.2c"
},
"DtsJobName": {
"Type": "String",
"Label": {
"en": "Dts Job Name",
"zh-cn": "Nama task sinkronisasi"
},
"Description": {
"en": "You are advised to configure a name with service significance (without unique requirement) for easy identification.",
"zh-cn": "Disarankan untuk menentukan nama deskriptif untuk task agar mudah diidentifikasi. Nama tersebut tidak perlu unik."
},
"Default": "mysql2redis_dts"
},
"RedisInstanceClass": {
"Type": "String",
"Label": {
"en": "Tair Specifications",
"zh-cn": "Spesifikasi Tair"
},
"Description": {
"en": "<font color='blue'>Before selecting a model, please confirm whether the model is in stock in the current availability zone. To save testing costs, it is recommended to use a model with 2G memory, for example:tair.rdb.2g</font>, see detail:<a href='https://www.alibabacloud.com/help/zh/redis/product-overview/enhanced-performance' target='_blank'><font color='red'>Specification inquiry</font></a>.",
"zh-cn": "<font color='blue'>Sebelum memilih tipe instans, pastikan tipe instans tersebut tersedia di zona ketersediaan saat ini. Untuk menghemat biaya pengujian, disarankan menggunakan spesifikasi dengan memori 2 GB, seperti tair.rdb.2g.</font> Untuk informasi selengkapnya, lihat <a href='https://www.alibabacloud.com/help/en/redis/product-overview/enhanced-performance' target='_blank'><font color='red'>Tipe instans</font></a>."
},
"AssociationProperty": "ALIYUN::REDIS::Instance::InstanceClass",
"AssociationPropertyMetadata": {
"Engine": "Redis",
"ProductType": "Tair_rdb",
"InstanceChargeType": "PostPaid",
"ZoneId": "${ZoneId1}",
"OrderType": "BUY"
},
"Default": "tair.rdb.2g"
},
"RedisPassword": {
"Type": "String",
"Label": {
"en": "Instance Password",
"zh-cn": "Kata sandi instans"
},
"Description": {
"en": "Length 8-32 characters, can contain size letters, Numbers and special symbols, including the following:! @ # $ % ^ & * ( ) _ + - =",
"zh-cn": "Kata sandi harus terdiri dari 8 hingga 32 karakter. Boleh mengandung huruf besar, huruf kecil, angka, dan karakter khusus berikut: !@#$%^&*()_+-="
},
"ConstraintDescription": {
"en": "8-32 characters, can contain size letters, Numbers and special symbols, including the following:! @ # $ % ^ & * ( ) _ + - =",
"zh-cn": "Kata sandi harus terdiri dari 8 hingga 32 karakter dan boleh mengandung huruf besar, huruf kecil, angka, serta karakter khusus berikut: !@#$%^&*()_+-="
},
"MinLength": "8",
"MaxLength": "32",
"NoEcho": true
}
},
"Resources": {
"Vpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": "192.168.0.0/16"
}
},
"VSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"ZoneId": {
"Ref": "ZoneId"
},
"VpcId": {
"Ref": "Vpc"
},
"VSwitchName": {
"Fn::Join": [
"-",
[
"VSwitch",
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
},
"CidrBlock": "192.168.0.0/24"
}
},
"RdsDBInstance": {
"Type": "ALIYUN::RDS::DBInstance",
"Properties": {
"ZoneId": {
"Ref": "ZoneId"
},
"VpcId": {
"Ref": "Vpc"
},
"VSwitchId": {
"Ref": "VSwitch"
},
"DBInstanceClass": {
"Ref": "DBInstanceClass"
},
"DBInstanceStorage": 100,
"Engine": "MySQL",
"EngineVersion": "8.0",
"MasterUserPassword": {
"Ref": "RDSDBPassword"
},
"MasterUserType": "Super",
"MasterUsername": {
"Ref": "RDSDBUser"
},
"DBMappings": [
{
"CharacterSetName": "utf8mb4",
"DBName": {
"Ref": "DbName"
}
}
],
"Category": "HighAvailability",
"DBInstanceStorageType": "cloud_essd",
"SecurityIPList": "192.168.0.0/16",
"SlaveZoneIds": [
{
"Ref": "ZoneId"
}
]
}
},
"RedisInstance": {
"Type": "ALIYUN::REDIS::Instance",
"Properties": {
"ZoneId": {
"Ref": "ZoneId"
},
"VpcId": {
"Ref": "Vpc"
},
"VSwitchId": {
"Ref": "VSwitch"
},
"InstanceClass": {
"Ref": "RedisInstanceClass"
},
"InstanceName": "rds_mysql2redis_redis",
"EvictionPolicy": "noeviction",
"EngineVersion": "6.0",
"Password": {
"Ref": "RedisPassword"
}
}
},
"Whitelist": {
"Type": "ALIYUN::REDIS::Whitelist",
"Properties": {
"InstanceId": {
"Ref": "RedisInstance"
},
"SecurityIps": "192.168.0.0/16"
}
},
"MigrationJob": {
"Type": "ALIYUN::DTS::SynchronizationJob2",
"Properties": {
"DtsJobName": {
"Ref": "DtsJobName"
},
"SourceEndpoint": {
"InstanceType": "RDS",
"InstanceID": {
"Ref": "RdsDBInstance"
},
"EngineName": "MYSQL",
"Region": {
"Ref": "ALIYUN::Region"
},
"UserName": {
"Ref": "RDSDBUser"
},
"Password": {
"Ref": "RDSDBPassword"
}
},
"DestinationEndpoint": {
"InstanceType": "Redis",
"InstanceID": {
"Ref": "RedisInstance"
},
"EngineName": "Redis",
"Region": {
"Ref": "ALIYUN::Region"
},
"Password": {
"Ref": "RedisPassword"
}
},
"StructureInitialization": false,
"DelayNotice": true,
"ErrorNotice": true,
"DelayRuleTime": 60,
"DataInitialization": true,
"DataSynchronization": true,
"DbList": {
"Fn::GetJsonValue": [
"DbList",
{
"Fn::Sub": "{ \"DbList\": { \"${DbName}\": { \"name\": \"0\", \"all\": true, \"customAttachedColumn\": { \"__DTS_TP_TO_REDIS_KEY__\": { \"name\": \"__DTS_TP_TO_REDIS_KEY__\", \"syntacticType\": \"ADD\", \"value\": \"__DB__+'.'+__TB__+'.'+pk_str_with_name_value('.','.')\", \"type\": \"STRING\", \"length\": \"\" }, \"__DTS_TP_TO_REDIS_VALUE__\": { \"name\": \"__DTS_TP_TO_REDIS_VALUE__\", \"syntacticType\": \"ADD\", \"value\": \"tp2redis_json_value()\", \"type\": \"STRING\", \"length\": \"\" } } }}}"
}
]
}
}
},
"DtsInstance": {
"Type": "ALIYUN::DTS::Instance",
"Properties": {
"JobId": {
"Fn::GetAtt": [
"MigrationJob",
"DtsJobId"
]
},
"InstanceClass": "small",
"PayType": "PostPaid",
"AutoStart": true,
"Type": "SYNC",
"SourceRegion": {
"Ref": "ALIYUN::Region"
},
"DestinationRegion": {
"Ref": "ALIYUN::Region"
},
"SourceEndpointEngineName": "MySQL",
"DestinationEndpointEngineName": "Redis"
}
}
},
"Outputs": {
"RdsInstanceAddress": {
"Description": {
"en": "RDS Instance Address.",
"zh-cn": "Alamat instans RDS."
},
"Value": {
"Fn::Sub": [
"https://rds.console.alibabacloud.com/detail/${InstanceID}/basicInfo?region=${Region}",
{
"InstanceID": {
"Ref": "RdsDBInstance"
},
"Region": {
"Ref": "ALIYUN::Region"
}
}
]
}
},
"TairInstanceAddress": {
"Description": {
"en": "Tair Instance Address.",
"zh-cn": "Alamat instans Tair."
},
"Value": {
"Fn::Sub": [
"https://kvstore.console.alibabacloud.com/Redis/instance/${Region}/${InstanceID}",
{
"InstanceID": {
"Ref": "RedisInstance"
},
"Region": {
"Ref": "ALIYUN::Region"
}
}
]
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"ZoneId"
],
"Label": {
"default": {
"en": "Infrastructure Configuration",
"zh-cn": "Konfigurasi sumber daya dasar (Wajib)"
}
}
},
{
"Parameters": [
"DBInstanceClass",
"DbName",
"RDSDBUser",
"RDSDBPassword"
],
"Label": {
"default": "RDS"
}
},
{
"Parameters": [
"RedisInstanceClass",
"RedisPassword"
],
"Label": {
"default": "Tair"
}
},
{
"Parameters": [
"DtsJobName"
],
"Label": {
"default": "DTS"
}
}
],
"TemplateTags": [
"acs:technical-solution:database:build-cache-consistency-by-syncing-rds-and-redis-in-real-time-tech_solu_21"
]
}
}
}Untuk contoh lainnya, lihat templat publik yang menyertakan resource ini.