Este tópico descreve como usar um modelo do Resource Orchestration Service (ROS) para criar uma instância do Tablestore.
Pré-requisitos
Procedimento
-
Acesse a página Stacks.
Faça login no console do ROS.
No painel de navegação à esquerda, escolha Deployment > Stacks.
Na barra de navegação superior, selecione uma região.
-
Crie uma stack.
Na página Stacks, clique em Create Stack.
Na seção Specify Template, clique em Select an Existing Template e defina o Template Import Method como Enter Template Content.
-
Na seção Template Content, na aba ROS, insira o modelo no formato
YAMLouJSONe clique em Next.V2 (recomendado)
O modelo a seguir exemplifica a criação de uma instância V2 do Tablestore. Para obter mais informações sobre sintaxe, parâmetros e exemplos, consulte 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
O modelo abaixo exemplifica a criação de uma instância V1 do Tablestore. Consulte ALIYUN::OTS::Instance para detalhes sobre sintaxe, parâmetros e exemplos adicionais.
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" ] } } } }YAML
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 Na etapa Configure Parameters, insira um Stack Name. Para modelos V2, especifique também o InstanceName e o ClusterType. Para mais detalhes sobre configurações de stack, consulte Stack configuration parameters.
-
Clique em Create.
Após a criação da stack, o Status na aba Stack Information exibirá Creation successful.
-
Verifique a implantação.
Clique na aba Resources para visualizar o Resource ID, correspondente ao nome da instância do Tablestore.
Acesse o console do Tablestore para visualizar a nova instância.
Na página Instance List, localize a nova instância, como
instance-demo, e confirme se o status é Running. O nome na coluna Instance Alias/Name corresponde ao ID do recurso da stack.