Before you create a stack group that has self-managed permissions in Resource Orchestration Service (ROS), you must manually create Resource Access Management (RAM) roles within the administrator and execution accounts and establish a trust relationship between the accounts. Then, you can deploy stacks within the execution account.
Background information
Before you grant self-managed permissions, you must create RAM roles for the Alibaba Cloud accounts in the following table and grant permissions to the roles.
Alibaba Cloud account | RAM role | Policy | Policy description |
Administrator account | AliyunROSStackGroupAdministrationRole | Custom policy: AssumeRole-AliyunROSStackGroupExecutionRole | Allows the AliyunROSStackGroupAdministrationRole RAM role to assume the AliyunROSStackGroupExecutionRole RAM role. |
Execution account | AliyunROSStackGroupExecutionRole | System policy: AdministratorAccess | Allows the AliyunROSStackGroupExecutionRole RAM role to manage all Alibaba Cloud resources that belong to the execution account. |
The administrator account and the execution account can be the same Alibaba Cloud account. For more information about administrator and execution accounts, see Overview.
When you use the administrator account to create a stack group in the ROS console after you grant the permissions to the roles, you can create stack instances in the stack group to deploy stacks within the execution account.
Method 1: Grant self-managed permissions in the RAM console
Grant permissions to the execution account.
Log on to the RAM console by using the execution account.
Create the AliyunROSStackGroupExecutionRole RAM role for the execution account and specify the administrator account as the trusted entity of the role.
In the left-side navigation pane, choose
.On the Roles page, click Create Role.
In the Select Role Type step of the Create Role wizard, set the Select Trusted Entity parameter to Alibaba Cloud Account and click Next.
Configure information about the RAM role.
In the RAM Role Name field, enter AliyunROSStackGroupExecutionRole.
In the Note field, enter a description for the RAM role.
Set the Select Trusted Alibaba Cloud Account parameter to Other Alibaba Cloud Account and enter the ID of the administrator account in the field.
Click OK.
Click Close.
Attach the AdministratorAccess policy to the AliyunROSStackGroupExecutionRole RAM role.
On the Roles page, find the AliyunROSStackGroupExecutionRole RAM role and click Grant Permission in the Actions column.
In the Grant Permission panel, the value of the Principal parameter is autopopulated. Set the Authorized Scope parameter to Alibaba Cloud Account.
Set the Select Policy parameter to System Policy and click AdministratorAccess.
Click OK.
Click Complete.
Grant permissions to the administrator account.
Log on to the RAM console by using the administrator account.
Create the AliyunROSStackGroupAdministrationRole RAM role for the administrator account and specify ROS as the trusted entity of the role.
In the left-side navigation pane, choose
.On the Roles page, click Create Role.
In the Select Role Type step of the Create Role wizard, set the Select Trusted Entity parameter to Alibaba Cloud Service and click Next.
Set the Role Type parameter to Normal Service Role.
Configure information about the RAM role.
In the RAM Role Name field, enter AliyunROSStackGroupAdministrationRole.
In the Note field, enter a description for the RAM role.
From the Select Trusted Service drop-down list, select Resource Orchestration Service.
Click OK.
Click Close.
Create the AssumeRole-AliyunROSStackGroupExecutionRole custom policy.
In the left-side navigation pane, choose
.On the Policies page, click Create Policy.
On the Create Policy page, click the JSON tab, enter the following policy content in the code editor, and then click Next to edit policy information. In the Name field, enter AssumeRole-AliyunROSStackGroupExecutionRole.
This policy allows the AliyunROSStackGroupAdministrationRole RAM role to assume the AliyunROSStackGroupExecutionRole RAM role.
{ "Statement": [ { "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "acs:ram::*:role/AliyunROSStackGroupExecutionRole" } ], "Version": "1" }
Click OK.
Attach the AssumeRole-AliyunROSStackGroupExecutionRole policy to the AliyunROSStackGroupAdministrationRole RAM role.
In the left-side navigation pane, choose
.On the Roles page, find the AliyunROSStackGroupAdministrationRole RAM role and click Grant Permission in the Actions column.
In the Grant Permission panel, the value of the Principal parameter is autopopulated. Set the Authorized Scope parameter to Alibaba Cloud Account.
Set the Select Policy parameter to Custom Policy and click AssumeRole-AliyunROSStackGroupExecutionRole.
Click OK.
Method 2: Grant self-managed permissions by using a ROS template
You can use a ROS template to create RAM roles for the administrator and execution accounts, and grant the permissions on stack groups and stacks to the roles.
Log on to the ROS console by using the administrator account. Then, use the AliyunROSStackGroupAdministrationRole template to create the RAM role and grant the required permissions to the role.
Log on to the ROS console by using the execution account. Then, use the AliyunROSStackGroupExecutionRole template to create the RAM role and grant the required permissions to the role.