Cloud Parallel File Storage (CPFS) uses service-linked roles to access other Alibaba Cloud services, such as Virtual Private Cloud and Object Storage Service. This topic describes the use cases, permissions, and deletion methods for these roles.
Background information
A service-linked role is a RAM role whose trusted entity is an Alibaba Cloud service. Cloud Parallel File Storage uses service-linked roles to access other cloud services or resources.
When you use a feature that requires a service-linked role, the system typically creates the role automatically. If the automatic creation fails or is not supported by Cloud Parallel File Storage, you must manually create the service-linked role.
RAM provides a system policy for each service-linked role. This policy cannot be modified. To view the policy content, go to the details page of the corresponding role in the RAM console.
For more information about service-linked roles, see Service-linked roles.
Use cases
The following service-linked roles are used by CPFS:
-
AliyunServiceRoleForNasCpfsNetwork
When you create or delete an elastic network interface (ENI) or a security group, CPFS uses this role to access VPC and ECS.
-
AliyunServiceRoleForNasCpfsClient
When you create or delete ECS instances, Cloud Assistant, or security groups, CPFS uses this role to access VPC and ECS.
-
AliyunServiceRoleForNasOssDataFlow
When you use the dataflow feature, CPFS uses this role to query, read, and write data in a specified OSS bucket.
-
AliyunServiceRoleForNasEventNotification
When you use the dataflow feature, CPFS uses this role to create and modify EventBridge parameters.
For more information about service-linked roles, see Service-linked roles.
Permissions
The permissions granted to each CPFS service-linked role are as follows:
Required permissions for RAM users
A RAM user must have the AliyunNASFullAccess permission to create or delete a service-linked role. Alternatively, an administrator can add the following permissions to the Action statement in a custom policy:
Create service-linked role:
ram:CreateServiceLinkedRoleDelete a service-linked role:
ram:DeleteServiceLinkedRole
For more information about how to grant permissions, see Permissions required to manage service-linked roles.
View a service-linked role
After a service-linked role is created, you can go to the Roles page in the RAM console, search for the role name (for example, AliyunServiceRoleForNasCpfsNetwork), and click the role name to view its details:
-
Basic information
In the Basic Information section of the AliyunServiceRoleForNasCpfsNetwork role details page, you can view basic information such as the role name, creation time, role ARN, and description.
-
Permissions
On the Permissions tab of the AliyunServiceRoleForNasCpfsNetwork role details page, click the policy name to view the policy content and the cloud resources that the role can access.
-
Trust policy
On the Trust Policy tab of the AliyunServiceRoleForNasStandard role details page, view the content of the trust policy. The trust policy describes the trusted entities that can assume this RAM role. The trusted entity for a service-linked role is a cloud service, which you can view in the
Servicefield of the trust policy.
For more information about how to view a service-linked role, see View a RAM role.
Delete a CPFS service-linked role
If you no longer use features such as CPFS dataflow, you can delete the corresponding service-linked role. Before you delete the role, you must first delete the CPFS file system instances that are associated with the role. For more information, see Delete a file system and Delete a service-linked role.
If the deletion fails because the role is still in use, wait a few minutes and try again.
After a service-linked role is deleted, features that depend on the role can no longer be used. Proceed with caution.
FAQ
Why can't a RAM user automatically create CPFS service-linked roles?
To resolve this issue, grant the RAM user the following system and custom policies. For more information, see Create a custom policy.
-
System policies
AliyunVPCFullAccess: Permissions to manage VPC.
AliyunBSSFullAccess: Permissions to manage Billing Management.
AliyunNASFullAccess: Permissions to manage NAS.
AliyunECSNetworkInterfaceManagementAccess: Permissions to manage ECS ENIs.
-
Custom policy
To manage mount targets, you need the
cpfs-network.nas.aliyuncs.comandcpfs-client.nas.aliyuncs.compermissions.To manage dataflows, you need the
oss-dataflow.nas.aliyuncs.comandevent-notification.nas.aliyuncs.compermissions.
Sample policy:
{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "ram:CreateServiceLinkedRole" ], "Resource": "*", "Condition": { "StringEquals": { "ram:ServiceName": [ "cpfs-network.nas.aliyuncs.com", "cpfs-client.nas.aliyuncs.com", "oss-dataflow.nas.aliyuncs.com", "event-notification.nas.aliyuncs.com" ] } } } ] }