Authorizing IAM Users to Manage Resources of an Account
Company B is a professional O&M company. It becomes a delegated party after being authorized by company A. Company B assigns permissions to one or more of its IAM users to manage company A's resources.
Requirements
- Company B wants to authorize its employees (IAM users) to manage the delegated resources of company A.
- If company A creates multiple agencies for company B, company B can allocate the agencies to different employees. This will allow each employee to only manage resources of specific agencies.
Solution
- Account B creates users on the IAM console, and grants the permissions (including Agent Operator) required for managing delegated resources to the users.
- Account B creates a custom policy with only the permissions required to manage the delegated resources of an agency. Then, account B attaches the policy to the group to which a user belongs, so that the user can only manage the resources of the agency.
Procedure
Account B performs the following procedure to authorize IAM users to manage resources of specific agencies. After authorization, the IAM users of account B can switch their roles to account A to manage account A's resources. To do this, account B needs to have obtained the HUAWEI CLOUD account name, agency name, and agency ID of the delegating party.
- Create a custom policy.
- To authorize a user to manage only the resources of a specific agency, perform the following steps.
- To authorize a user to manage the resources of all agencies, go to 2.
- Log in to the HUAWEI CLOUD management console using account B.
- On the IAM console, choose Permissions in the navigation pane, and click Create Custom Policy.
- Enter the policy name, for example, Agency 1 Management for Company A.
- Select Global services for Scope.
- Select JSON.
- In the Policy Content area, enter the following content:
{ "Version": "1.1", "Statement": [ { "Action": [ "iam:agencies:assume" ], "Resource": { "uri": [ "/iam/agencies/b36b1258b5dc41a4aa8255508xxx..." ] }, "Effect": "Allow" } ] }
Replace b36b1258b5dc41a4aa8255508xxx... with an agency ID.
- Click OK.
- Create a user group and grant permissions to it.
- In the navigation pane, choose User Groups.
- On the User Groups page, click Create User Group.
- Enter the user group name, for example, Agency Management.
- Click OK.
The user group is displayed in the user group list.
- Click Manage Permissions in the row containing the user group, click Assign Permissions, and then select an authorization scope.
- Select the Agency 1 Management for Company A agency created in 1 or the Agent Operator role.
- The custom policy allows the user only to manage resources of a specific agency ID.
- The Agent Operator role allows the user to manage the resources of all agencies.
- Click OK.
- Create a user and add the user to the user group.
- In the navigation pane, choose Users.
- On the Users page, click Create User.
- On the Create User page, enter a username and email address.
- For the access type, select Management console access and Set by user.
- Enable login protection, select a verification mode, and click Next.
- Select the Agency Management group created in 2, and click Next.
- Click OK.
- Switch the role.
- Log in to HUAWEI CLOUD as the user created in 3. For more information, see Logging In as an IAM User.
- Click the username in the upper right corner, and choose Switch Role.
- Enter the account name of the delegating party. The agency created by the delegating party is displayed automatically.
If an agency other than the agencies created by the delegating party is displayed, a message is displayed indicating that you do not have access permissions. Select the correct agency in the Agency Name drop-down list box.
- Click OK to switch to the delegating account.
Last Article: Cross-Account Access Delegation and Resource Management
Next Article: Multi-project Management
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.