To create a stack group with self-managed permissions, manually create RAM roles in the administrator and execution accounts to establish a trust relationship for stack deployment.
Background
Grant self-managed permissions by creating and authorizing RAM roles for the following Alibaba Cloud accounts:
|
Alibaba Cloud account |
RAM role |
Policy |
Description |
|
administrator account |
AliyunROSStackGroupAdministrationRole |
Custom policy: AssumeRole-AliyunROSStackGroupExecutionRole |
Allows AliyunROSStackGroupAdministrationRole to assume AliyunROSStackGroupExecutionRole. |
|
execution account |
AliyunROSStackGroupExecutionRole |
System policy: AdministratorAccess |
Grants AliyunROSStackGroupExecutionRole full access to all resources in the execution account. |
The administrator and execution accounts can be the same Alibaba Cloud account. Overview explains the account roles.
After granting permissions, log on to the ROS console with the administrator account to create a stack group and deploy stacks to the execution account.
Method 1: Use the RAM console
-
Configure permissions for the execution account.
-
Log on to the RAM console with an execution account.
-
Create a RAM role named AliyunROSStackGroupExecutionRole and set the administrator account as the trusted entity.
-
In the left-side navigation pane, choose .
-
On the Roles page, click Create Role.
-
On the Create Role page, set Trusted Entity Type to Cloud Account.
-
Set Trusted Cloud Account to Other Cloud Account, and enter the ID of the administrator account.
-
Click OK. In the dialog box that appears, enter AliyunROSStackGroupExecutionRole in the Role Name field.
-
Click OK to complete the creation.
-
-
Grant the AdministratorAccess permission to AliyunROSStackGroupExecutionRole.
-
On the Roles page, find the AliyunROSStackGroupExecutionRole RAM role and click Grant Permission in the Actions column.
-
In the Grant Permission panel, set Resource Scope to Account Level. The principal is automatically populated.
-
Select System Policy and then select the AdministratorAccess policy.
-
Click Confirm Grant Permission.
-
-
-
Configure permissions for the administrator account.
-
Log on to the RAM console with the administrator account.
-
Create a RAM role named AliyunROSStackGroupAdministrationRole and set Resource Orchestration Service as the trusted entity.
-
In the left-side navigation pane, choose .
-
On the Roles page, click Create Role.
-
On the Create Role page, set Trusted Entity Type to Cloud Service.
-
Set Principal to Resource Orchestration Service and click OK.
-
In the dialog box that appears, enter AliyunROSStackGroupAdministrationRole in the Role Name field.
-
Click OK to complete the creation.
-
-
Create a custom policy named AssumeRole-AliyunROSStackGroupExecutionRole.
-
In the left-side navigation pane, choose .
-
On the Policies page, click Create Policy.
-
On the Create Policy page, click the Script Editor tab, enter the following policy content, and click OK. Then, set Name to AssumeRole-AliyunROSStackGroupExecutionRole.
This policy allows AliyunROSStackGroupAdministrationRole to assume AliyunROSStackGroupExecutionRole.
{ "Statement": [ { "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "acs:ram::*:role/AliyunROSStackGroupExecutionRole" } ], "Version": "1" } -
Click OK to complete the creation.
-
-
Grant the AssumeRole-AliyunROSStackGroupExecutionRole permission to AliyunROSStackGroupAdministrationRole.
-
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, set Resource Scope to Account Level. The principal is automatically populated.
-
Select Custom Policy and then select the AssumeRole-AliyunROSStackGroupExecutionRole policy.
-
Click Confirm Grant Permission.
-
-
Method 2: Use the ROS console
Use ROS templates to create RAM roles and grant permissions for the administrator and execution accounts.
-
Log on to the ROS console with the administrator account and use the AliyunROSStackGroupAdministrationRole template to create the RAM role and grant permissions.
-
Log on to the ROS console with an execution account and use the AliyunROSStackGroupExecutionRole template to create the RAM role and grant permissions.