Topik ini menjelaskan cara menggunakan templat Resource Orchestration Service (ROS) untuk membuat instans Tablestore.
Prasyarat
Anda telah mengaktifkan Tablestore.
Prosedur
-
Buka halaman Stacks.
-
Login ke ROS console.
-
Pada panel navigasi kiri, pilih Deployment > Stacks.
-
Pada bilah navigasi atas, pilih wilayah.
-
-
Buat stack.
-
Pada halaman Stacks, klik Create Stack.
-
Pada bagian Specify Template, klik Select an Existing Template, lalu atur Template Import Method menjadi Enter Template Content.
-
Pada bagian Template Content, di tab ROS, masukkan templat dalam format
YAMLatauJSON, lalu klik Next.V2 (direkomendasikan)
Templat berikut merupakan contoh cara membuat instans Tablestore V2. Untuk informasi lebih lanjut mengenai sintaksis, parameter, dan contoh, lihat ALIYUN::OTS::InstanceV2.
JSON{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "InstanceName": { "Type": "String", "Description": { "en": "Specifies the instance name. The name must meet the following requirements:\n- Be 3 to 16 characters long.\n- Contain only letters, numbers, and dashes (-).\n- Start with a letter.\n- Not end with a dash (-).\n- Be case-insensitive." }, "Required": true, "AllowedPattern": "[A-Za-z][A-Za-z0-9\\-]*[A-Za-z0-9]$", "MinLength": 3, "MaxLength": 16 }, "ClusterType": { "Type": "String", "Description": { "en": "The cluster type, which corresponds to the instance type.\nValid values:\n- SSD: High-performance\n- HYBRID: Capacity" }, "AllowedValues": [ "SSD", "HYBRID" ], "Required": true } }, "Resources": { "InstanceV2": { "Type": "ALIYUN::OTS::InstanceV2", "Properties": { "InstanceName": { "Ref": "InstanceName" }, "InstanceDescription": "The description of the instance.", "ClusterType": { "Ref": "ClusterType" }, "NetworkSourceACL": [ "TRUST_PROXY" ], "NetworkTypeACL": [ "INTERNET", "VPC", "CLASSIC" ], "Tags": [ { "Key": "environment", "Value": "testing" } ] } } }, "Outputs": { "InstanceName": { "Description": "The name of the Tablestore instance.", "Value": { "Fn::GetAtt": [ "InstanceV2", "InstanceName" ] } } } }YAMLROSTemplateFormatVersion: '2015-09-01' Parameters: InstanceName: Type: String Description: en: | Specifies the instance name. The name must meet the following requirements: - Be 3 to 16 characters long. - Contain only letters, numbers, and dashes (-). - Start with a letter. - Not end with a dash (-). - Be case-insensitive. Required: true AllowedPattern: '[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9]$' MinLength: 3 MaxLength: 16 ClusterType: Type: String Description: en: |- The cluster type, which corresponds to the instance type. Valid values: - SSD: High-performance - HYBRID: Capacity AllowedValues: - SSD - HYBRID Required: true Resources: InstanceV2: Type: ALIYUN::OTS::InstanceV2 Properties: InstanceName: Ref: InstanceName InstanceDescription: The description of the instance. ClusterType: Ref: ClusterType NetworkSourceACL: - TRUST_PROXY NetworkTypeACL: - INTERNET - VPC - CLASSIC Tags: - Key: "environment" Value: "testing" Outputs: InstanceName: Description: The name of the Tablestore instance. Value: Fn::GetAtt: - InstanceV2 - InstanceNameV1
Templat berikut merupakan contoh cara membuat instans Tablestore V1. Untuk informasi lebih lanjut mengenai sintaksis, parameter, dan contoh, lihat ALIYUN::OTS::Instance.
JSON{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { }, "Resources": { "Instance": { "Type": "ALIYUN::OTS::Instance", "Properties": { "InstanceName": "instance-demo", "Description": "The description of the instance.", "ClusterType": "SSD", "Network": "NORMAL" } } }, "Outputs": { "InstanceName": { "Description": "The instance name.", "Value": { "Fn::GetAtt": [ "Instance", "InstanceName" ] } }, "VpcEndpoint": { "Description": "The VPC endpoint.", "Value": { "Fn::GetAtt": [ "Instance", "VpcEndpoint" ] } }, "PublicEndpoint": { "Description": "The public endpoint.", "Value": { "Fn::GetAtt": [ "Instance", "PublicEndpoint" ] } }, "PrivateEndpoint": { "Description": "The private endpoint.", "Value": { "Fn::GetAtt": [ "Instance", "PrivateEndpoint" ] } } } }YAMLROSTemplateFormatVersion: '2015-09-01' Parameters: {} Resources: Instance: Type: ALIYUN::OTS::Instance Properties: InstanceName: instance-demo Description: The description of the instance. ClusterType: SSD Network: NORMAL Outputs: InstanceName: Description: The instance name. Value: Fn::GetAtt: - Instance - InstanceName VpcEndpoint: Description: The VPC endpoint. Value: Fn::GetAtt: - Instance - VpcEndpoint PublicEndpoint: Description: The public endpoint. Value: Fn::GetAtt: - Instance - PublicEndpoint PrivateEndpoint: Description: The private endpoint. Value: Fn::GetAtt: - Instance - PrivateEndpoint -
Pada langkah Configure Parameters, masukkan Stack Name. Untuk templat V2, tentukan juga InstanceName dan ClusterType. Untuk informasi lebih lanjut mengenai konfigurasi stack, lihat Stack configuration parameters.
-
Klik Create.
Saat stack berhasil dibuat, statusnya pada tab Stack Information akan berubah menjadi Creation successful.
-
-
Verifikasi penerapan.
Klik tab Resources untuk melihat Resource ID, yang merupakan nama instans Tablestore.
Anda dapat login ke Tablestore console untuk melihat instans baru tersebut.
Pada halaman Instance List, cari instans baru, misalnya
instance-demo, dan pastikan statusnya adalah Running. Nama pada kolom Instance Alias/Name merupakan Resource ID dari stack tersebut.