You can use Resource Orchestration Service (ROS) to call API operations of Alibaba Cloud CDN. This topic describes how to create an ROS template and use the template to automatically add a domain name to Alibaba Cloud CDN.
Supported resources
ROS is an Alibaba Cloud service that simplifies the management of cloud computing resources. You can create a template to describe the cloud computing resources that you want to use, such as Elastic Compute Service (ECS) and ApsaraDB RDS instances, and the relationship 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 Alibaba Cloud CDN. Resources that can be orchestrated by using ROS include regular resources and data resources.
Regular resources:
ALIYUN::CDN::Domain: adds a domain name to Alibaba Cloud CDN.
ALIYUN::CDN::DomainConfig: configures multiple domain name settings.
Data resources:
DATASOURCE::CDN::Domains: queries basic information about Alibaba Cloud CDN-accelerated domain names.
Permissions
In this example, you need to add a domain name. 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:
AliyunCDNFullAccess: full access to Alibaba Cloud CDN 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 Alibaba Cloud CDN resources. For more information, see Alibaba Cloud CDN system policies.
Procedure
Log on to the ROS console. In the top navigation bar, select a region from the region drop-down list.
In the left-side navigation pane, click Stacks. On the Stacks page, choose
.Specify Template: Select Select an Existing Template.
Template Import Method: Select Enter Template Content.
Template Content: Select ROS and then enter code.
For more information about the syntax, description, and examples of how to add a domain name, see ALIYUN::CDN::Domain.
Click Next.
In the Configure Parameters step, configure the parameters and click Create.
View the created stack.
After the stack is created, call API operations, use SDKs, or log on to the Alibaba Cloud CDN console to view the domain name.