All Products
Search
Document Center

Tair (Redis® OSS-Compatible):ROS integration example

Last Updated:Jun 20, 2026

This topic describes how a RAM user can use Resource Orchestration ServiceROS to create a Tair (Enterprise Edition) instance and a database account for the instance.

Create a RAM user and grant permissions

If you have created a RAM user and granted the required permissions, you can skip this section.

  1. Create a RAM user:

    1. Go to the Users page and click Create User.

    2. Set Logon Name to redis-ros-test. For Access Mode, select Programmatic access.

    3. Click OK. After the RAM user is created, save the AccessKey ID and AccessKey secret.

  2. Grant permissions:

    1. Go to the Users page. In the Actions column for the target RAM user, click Add Permissions.

    2. In the search box, enter AliyunKvstore and select the AliyunKvstoreFullAccess policy.

      Note

      For demonstration purposes, this example uses the AliyunKvstoreFullAccess policy, which grants full permissions to query and modify Tair instances.

      In a production environment, grant only the permissions that your use case requires or create a more fine-grained custom policy. For more information, see identity management.

    3. Click OK to complete the authorization.

Procedure

  1. Click the link to quickly configure the ROS template to open the ROS console.

    The ROS template is pre-filled for this example. You can proceed with the following configuration.

    (Optional) JSON template

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": {
        "en": "Create the Redis instance, and create a new database account.",
        "zh-cn": "创建Redis实例,并新建一个数据库账号。"
      },
      "Parameters": {
        "ZoneId": {
          "Type": "String",
          "Description": {
            "zh-cn": "创建实例前,请确认可用区是否支持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": "可用区"
          }
        },
        "VpcId": {
          "Type": "String",
          "Label":{
            "zh-cn":"专有网络",
            "en":"VPC ID"
          },
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
        },
        "VSwitchId": {
          "Type": "String",
          "Label": {
            "en": "VSwitch ID",
            "zh-cn": "虚拟交换机"
          },
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}",
            "ZoneId": "${ZoneId}"
          }
        },
        "AccountName":{
          "Type":"String",
          "Label":{
            "zh-cn":"账号",
            "en":"Account"
          },
          "Default":"ros_user"
        },
        "AccountPassword":{
          "Type":"String",
          "Label":{
            "zh-cn":"密码",
            "en":"Account Password"
          }
        }
      },
      "Resources": {
        "RedisInstance": {
          "Type": "ALIYUN::REDIS::Instance",
          "Properties": {
            "VpcId": {
              "Ref": "VpcId"
            },
            "VSwitchId": {
              "Ref": "VSwitchId"
            },
            "InstanceName": "ros_example",
            "InstanceClass": "tair.rdb.with.proxy.1g",
            "ShardCount": 2,
            "ZoneId": {
              "Ref": "ZoneId"
            }
          }
        },
        "Account": {
          "DependsOn":[
            "RedisInstance"
          ],
          "Type": "ALIYUN::REDIS::Account",
          "Properties": {
            "AccountDescription": "Test Create Redis Account",
            "InstanceId": {
              "Ref": "RedisInstance"
            },
            "AccountType": "Normal",
            "AccountName": {
              "Ref":"AccountName"
            },
            "AccountPrivilege": "RoleReadWrite",
            "AccountPassword": {
              "Ref":"AccountPassword"
            }
          }
        }
      },
      "Outputs": {
        "InstanceId": {
          "Value": {
            "Fn::GetAtt": [
              "RedisInstance",
              "InstanceId"
            ]
          }
        },
        "AccountName": {
          "Description": {
            "zh-cn": "账号",
            "en": "Account"
          },
          "Value": {
            "Ref": "AccountName"
          }
        }
      }
    }
  2. In the upper-left corner of the top navigation bar, select a region.

  3. On the Create Stack page, enter a name for the stack.

  4. Configure the following template parameters, leaving the others at their default values. For more information about creating a stack, see Use a template to create a stack.

    1. Select an availability zone, a VPC, and a vSwitch.

    2. Enter the account name and password.

  5. Click Next: Check and Confirm.

    The page displays the order information and estimated cost. This example creates a pay-as-you-go Tair memory-optimized cluster edition instance with 2 GB of memory and 2 shards.

  6. Confirm the order information and click Create.

    The stack is created when its Status on the Stack Information tab changes to Create Succeeded.

  7. After the stack is created, click the Outputs tab to view the new instance ID and account name.

    You can view the new instance by using OpenAPI, an SDK, or the Tair console.

Next steps

To release the instance, see Release pay-as-you-go instances.