Resource Orchestration Service service-linked roles

Updated at:

Resource Orchestration Service (ROS) uses two service-linked roles for stack groups with service-managed permissions: AliyunServiceRoleForROSStackGroupsRDAdmin and AliyunServiceRoleForROSStackGroupsRDMember. This topic covers their scenarios, access policies, creation, and deletion.

Scenarios

AliyunServiceRoleForROSStackGroupsRDAdmin and AliyunServiceRoleForROSStackGroupsRDMember are RAM roles used with stack groups that have service-managed permissions. ROS assumes these roles to retrieve account information from the resource directory of an administrator account and deploy stacks to member accounts.

For more information about service-linked roles, see Service-linked roles.

Permissions

  • AliyunServiceRoleForROSStackGroupsRDAdmin

    Access policy: AliyunServiceRolePolicyForROSStackGroupsRDAdmin.

    Description: ROS uses this role to retrieve account information from the resource directory.

    {
      "Statement": [
        {
          "Action": [
            "resourcemanager:ListAccountsForParent",
            "resourcemanager:ListFoldersForParent",
            "resourcemanager:ListAncestors"
          ],
          "Effect": "Allow",
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": "sts:AssumeRole",
          "Resource": "acs:ram:*:*:role/stackgroups-exec-*"
        },
        {
          "Action": "ram:DeleteServiceLinkedRole",
          "Resource": "*",
          "Effect": "Allow",
          "Condition": {
            "StringEquals": {
              "ram:ServiceName": "stackgroups-admin.ros.aliyuncs.com"
            }
          }
        }
      ],
      "Version": "1"
    }
  • AliyunServiceRoleForROSStackGroupsRDMember

    Access policy: AliyunServiceRolePolicyForROSStackGroupsRDMember.

    Description: ROS uses this role to dynamically create RAM roles that are prefixed with stackgroups-exec- and deploy stacks by assuming these roles.

    {
      "Statement": [
        {
          "Action": [
              "ram:CreateRole",
              "ram:GetRole",
              "ram:DeleteRole"
            ],
          "Effect": "Allow",
          "Resource": "acs:ram:*:*:role/stackgroups-exec-*"
        },
        {
          "Action": [
              "ram:AttachPolicyToRole",
              "ram:DetachPolicyFromRole"
            ],
          "Effect": "Allow",
          "Resource": [
            "acs:ram:*:*:role/stackgroups-exec-*",
            "acs:ram:*:system:policy/AdministratorAccess"
          ]
        },
        {
          "Action": "ram:DeleteServiceLinkedRole",
          "Resource": "*",
          "Effect": "Allow",
          "Condition": {
            "StringEquals": {
              "ram:ServiceName": "stackgroups-member.ros.aliyuncs.com"
            }
          }
        }
      ],
      "Version": "1"
    }

Creating the service-linked roles

When an administrator account creates stack instances in a stack group with service-managed permissions, the AliyunServiceRoleForROSStackGroupsRDAdmin service-linked role is created in the administrator account. This role retrieves account information from the Resource Directory. The AliyunServiceRoleForROSStackGroupsRDMember service-linked role is created in all retrieved member accounts and dynamically creates standard RAM roles prefixed with stackgroups-exec-. These roles are then used to deploy stacks. The roles prefixed with stackgroups-exec- are deleted when the stack instance is successfully deleted.

For more information, see Step 3: Create a stack group.

Delete a service-linked role

  • To delete the AliyunServiceRoleForROSStackGroupsRDAdmin service-linked role from an administrator account, you must first delete all stack groups that have service-managed permissions in that account.
    1. Delete the stack groups. For more information, see Delete a stack group.
    2. Delete the service-linked role. For more information, see Delete a service-linked role.
  • To delete the AliyunServiceRoleForROSStackGroupsRDMember service-linked role from a member account, you must first delete all stack instances related to that member account.
    1. Delete the stack instances. For more information, see Delete a single stack instance.
    2. Delete the service-linked role. For more information, see Delete a service-linked role.