You can use Resource Orchestration Service (ROS) to call API operations of ENS. This topic describes how to create a ROS template and use the template to automatically create an ENS instance.
Supported resources
ROS is an Alibaba Cloud service that simplifies the management of cloud computing resources. You can create a template to describe the required cloud computing resources such as Elastic Compute Service (ECS) and ApsaraDB RDS instances, and the dependencies between the resources. ROS automatically creates and configures all resources based on the template to implement automated deployment and O&M. For more information, see What is ROS?
You can use ROS to call API operations of ENS. Resources that can be orchestrated using ROS include regular resources and data resources.
Regular resources:
ALIYUN::ENS::Disk: creates a pay-as-you-go or subscription data disk.
ALIYUN::ENS::DiskInstanceAttachment: attaches a data disk to an ENS instance.
ALIYUN::ENS::Instance: creates an ENS instance.
ALIYUN::ENS::InstanceSecurityGroupAttachment: adds an ENS instance to a security group.
ALIYUN::ENS::KeyPair: imports the public key of a Rivest-Shamir-Adleman (RSA)-encrypted key pair.
ALIYUN::ENS::Network: creates a virtual private cloud (VPC).
ALIYUN::ENS::NetworkAcl: creates a network access control list (ACL).
ALIYUN::ENS::NetworkAclAssociation: associates an ACL with networks.
ALIYUN::ENS::SecurityGroup: creates a security group.
ALIYUN::ENS::Snapshot: creates a snapshot.
ALIYUN::ENS::VSwitch: creates a vSwitch.
Data resources:
DATASOURCE::ENS::Instances: queries the details of ENS instances.
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 as needed. The RAM user must have the permissions to manage ENS resources. For more information, see System policies for ENS.
Procedure
Log on to the ROS console. In the top navigation bar, select a region from the Region drop-down list.
On the Stacks page, click Create Stack. In the Specify Template section, click Select an Existing Template.
NoteIf you select Create a New Template or ROS Infrastructure Composer, you are redirected to the corresponding page.
For Template Import Method, select Enter Template Content. For Template Content, select ROS, and enter the code.
For more information about the syntax, description, and examples of how to create an ENS instance, see ALIYUN::ENS::Instance.
Click Next and Create to execute the created stack.
After the ENS instance is created, call API operations, use SDKs, or go to the ENS console to view the created ENS instance.
