Using IAM Identity Policies to Grant Access to Cloud Connections
System-defined permissions in identity policy-based authorization provided by IAM let you control access to your Cloud Connect resources. With IAM, you can:
- Create IAM users or user groups for personnel based on your enterprise's organizational structure. Each IAM user has their own identity credentials for accessing Cloud Connect resources.
- Grant users only the permissions required to perform a given task based on their job responsibilities.
- Entrust a Huawei Cloud account or a cloud service to perform efficient O&M on your Cloud Connect resources.
If your Huawei Cloud account meets your permissions requirements, you can skip this section.
Figure 1 shows the process flow of identity policy-based authorization.
Prerequisites
Before granting permissions to user groups, learn about system-defined permissions in Identity Policy-based Authorization for Cloud Connect. To grant permissions for other services, learn about all system-defined permissions supported by IAM.
Process Flow
- On the IAM console, create an IAM user or create a user group.
- Attach a system-defined policy (CCReadOnlyPolicy as an example) to the user or user group.
- Log in as the IAM user and verify permissions.
In the authorized region, perform the following operations:
- In the service list, choose Networking > Cloud Connect. Click Create Cloud Connection in the upper right corner. If the cloud connection can be created, the CCReadOnlyPolicy policy has taken effect.
- Choose any other service in the service list. If a message appears indicating that you have insufficient permissions to access the service, the CCReadOnlyPolicy policy is in effect.
Example Custom Policies
You can create custom identity policies to supplement the system-defined identity policies of Cloud Connect. For the actions supported for custom policies, see "Identity Policy-based Authorization" in the Cloud Connect API Reference.
You can create custom policies in either of the following ways:
- Visual editor: Select cloud services, actions, resources, and request conditions. This does not require knowledge of policy syntax.
- JSON: Create a JSON policy or edit an existing one.
For details, see Creating a Custom Policy and Attaching It to a Principal.
When creating a custom policy, use the Resource element to specify the resources the policy applies to and use the Condition element (condition keys) to control when the policy is in effect. For the supported resource types and condition keys, see "Identity Policy-based Authorization" in the Cloud Connect API Reference.
The following are examples of common custom policies.
- Example 1: Granting permissions to create and delete cloud connections
{ "Version": "5.0", "Statement": [ { "Effect": "Allow", "Action": [ "cc:cloudConnections:create", "cc:cloudConnections:delete" ] } ] } - Example 2: Creating a custom policy containing multiple actions
A custom policy can contain the actions of one or multiple services. The following is a custom policy containing multiple actions:
{ "Version": "5.0", "Statement": [ { "Effect": "Allow", "Action": [ "cc:cloudConnections:create", "cc:cloudConnections:delete" ] }, { "Effect": "Allow", "Action": [ "vpc:vpcs:create", "vpc:vpcs:list" ] }, { "Effect": "Allow", "Action": [ "ecs:cloudServers:createServers", "ecs:cloudServers:listServersDetails" ] } ] }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
