All Products
Search
Document Center

ENS:Resource integration by using ROS

Last Updated:Sep 04, 2024

You can use Resource Orchestration Service (ROS) to call API operations of ENS. This topic describes how to create an Resource Orchestration Service template and use the template to automatically create an ENS instance.

Supported resources

Permissions

In this example, you need to create an ENS instance. By default, Resource Orchestration Service uses the credentials of the user who logs on to the ROS console. The user must be granted the following permissions:

  • AliyunENSFullAccess: permissions to manage ENS resources.

An Alibaba Cloud account has permissions on all API operations. Security risks may arise if you use an Alibaba Cloud account to call API operations. We strongly recommend that you call API operations or perform routine O&M as a RAM user. Before you call API operations as a RAM user, grant the required permissions to the RAM user based on your business requirements. The RAM user must have the permissions to manage ENS resources. For more information, see System policies for ENS.

Procedure

  1. Log on to the ROS console. In the top navigation bar, select a region from the Region drop-down list.

  2. In the left-side navigation pane, click Stacks. On the Stacks page, choose Create Stack > Use ROS.

    • Specify Template: Select Select an Existing Template.

    • Template Import Method: Select Enter Template Content.

  3. Template Content: Select ROS and then enter code.

    For more information about the syntax, description, and examples of how to create an ENS instance, see ALIYUN::ENS::Instance.

    YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Resources:
      ENSInstance:
        Type: ALIYUN::ENS::Instance
        Properties:
          EnsRegionId: cn-chengdu-telecom-3
          ImageId: centos_6_08_64_20G_alibase_20171208
          InstanceType: ens.sn1.stiny
          InternetChargeType: 95BandwidthByMonth
          Password: Enstest1xx
          Period: 1
          Quantity: 2
          SystemDiskSize: 20
          DataDiskSize: 20
          PaymentType: Subscription
    Outputs: {}

    JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Resources": {
        "ENSInstance": {
          "Type": "ALIYUN::ENS::Instance",
          "Properties": {
            "EnsRegionId": "cn-chengdu-telecom-3",
            "ImageId": "centos_6_08_64_20G_alibase_20171208",
            "InstanceType": "ens.sn1.stiny",
            "InternetChargeType": "95BandwidthByMonth",
            "Password": "Enstest1xx",
            "Period": 1,
            "Quantity": 2,
            "SystemDiskSize": 20,
            "DataDiskSize": 20,
            "PaymentType": "Subscription"
          }
        }
      },
      "Outputs": {
      }
    }
  4. Click Create and execute the created stack.

  5. After the ENS instance is created, call API operations, use SDKs, or go to the ENS console to view the created ENS instance.

    image