You can use the management account or a member of a resource directory to share resources with all members in the resource directory, all members in a specific folder in the resource directory, or a specific member in the resource directory.
Background information
In this example, a resource owner (the management account of a resource directory) shares one or more vSwitches in a virtual private cloud (VPC) within the resource owner to a member in the resource directory.
Step 1: Enable resource sharing
-
Log on to the Resource Management console by using the management account of your resource directory.
-
In the left-side navigation pane, choose Resource Sharing > Settings.
-
Click Enable.
-
In the Service-linked Role for Resource Sharing dialog box, click OK.
The system creates a service-linked role named AliyunServiceRoleForResourceSharing to obtain the organizational structure of the resource directory. For more information, see Service-linked role for Resource Sharing.
Step 2: Create a resource share
-
Log on to the Resource Management console as a resource owner.
-
In the navigation pane on the left, choose Resource Sharing > Resources I Share.
-
In the top navigation bar, select the region where the resources to be shared reside.
ImportantIf you want to share global resources, such as templates in Resource Orchestration Service (ROS), you can select only the China (Shanghai) region to create resource shares.
-
Click Create Resource Share, and then configure the resource share.
-
Configure basic information and add resources.
Enter a resource share name, add tags to the resource share based on your business requirements, and then add select resources to be shared. In this example, vSwitches are selected for sharing.
-
Add permissions.
Permissions specify the operations that principals can perform on shared resources. In this example, select AliyunRSDefaultPermissionVSwitch. Click the permission name to view its details.
-
Add principals.
Set Principal Scope to Objects Within Resource Directory, set Method to Add from Resource Directory , and then select a folder or member from the resource directory. In this example, a member is selected.
-
Confirm the configurations and click OK.
-
Step 3: Verify the result
You can use one of the following methods to check whether resources are successfully shared:
-
Resource owner
On the details page of the resource share in the Resource Management console, check the sharing status. If the status of both the resource and the principal is Associated, the sharing is successful.
-
Principal
In the console of the Alibaba Cloud service to which the resources belong, view and manage the resources. In this example, you can use a member to log on to the VPC console and view the vSwitches that are shared.
In the list of vSwitches, a blue Shared label appears under the instance name of the shared vSwitch (such as vs3). It belongs to the VPC owned by the resource owner (such as test3).