Assigning Basic Permissions for Using Development Environments to an IAM User
Description
This section describes the basic permissions required by IAM users for using development environments. You can assign permissions for specific scenarios by referring to Permissions List. In this example, an IAM user is authorized to use a notebook instance for debugging, and data and code are stored in a parallel file system. Use a management account to perform the following configuration operations.
Permissions List
- Permission
Table 1 Permissions required by development environments Application Scenario
Dependent Service
Dependent Policy
Supported Function
Configuration Suggestion
Lifecycle management of a development environment instance
ModelArts
modelarts:notebook:create
modelarts:notebook:list
modelarts:notebook:get
modelarts:notebook:update
modelarts:notebook:delete
modelarts:notebook:start
modelarts:notebook:stop
modelarts:notebook:updateStopPolicy
modelarts:image:delete
modelarts:image:list
modelarts:image:create
modelarts:image:get
modelarts:pool:list
modelarts:tag:list
modelarts:network:get
aom:metric:get
aom:metric:list
aom:alarm:list
Start, stop, create, delete, and update an instance.
After the modelarts:notebook:list or modelarts:notebook:get permission is configured, you can open a notebook instance by default.
Recommended.
Explicit authorization for these permissions is required only after strict authorization is enabled. By default, a newly created account uses the strict authorization mode.
Dynamically mounting storage
ModelArts
modelarts:notebook:listMountedStorages
modelarts:notebook:mountStorage
modelarts:notebook:getMountedStorage
modelarts:notebook:umountStorage
Dynamically mount storage.
Configured as required.
OBS
obs:bucket:ListAllMyBuckets
obs:bucket:ListBucket
Image management
ModelArts
modelarts:image:register
modelarts:image:listGroup
Register and view an image on the Image Management page.
Configured as required.
Saving an image
SWR
SWR Admin
The SWR Admin policy contains the maximum scope of SWR permissions, which can be used to:
- Save a running development environment instance as an image.
- Create a notebook instance using a custom image.
Configured as required.
Using the SSH function
ECS
ecs:serverKeypairs:list
ecs:serverKeypairs:get
ecs:serverKeypairs:delete
ecs:serverKeypairs:create
Configure a login key for a notebook instance.
Configured as required.
DEW
kps:domainKeypairs:get
kps:domainKeypairs:list
kps:domainKeypairs:createkmskey
KMS
kms:cmk:list
Mounting an SFS Turbo file system
SFS Turbo
SFS Turbo FullAccess
Read and write an SFS directory as an IAM user. Mount an SFS file system that is not created by you to a notebook instance using a dedicated resource pool as an IAM user.
Configured as required.
Viewing all instances
ModelArts
modelarts:notebook:listAllNotebooks
View development environment instances of all users on the ModelArts management console. The policies are required by the development environment instance administrator.
Configured as required.
IAM
iam:users:listUsers
Local VS Code plug-in or PyCharm Toolkit
ModelArts
modelarts:notebook:listAllNotebooks
modelarts:trainJob:create
modelarts:trainJob:list
modelarts:trainJob:update
modelarts:trainJobVersion:delete
modelarts:trainJob:get
modelarts:trainJob:logExport
modelarts:workspace:getQuotas (This policy is required if the workspace function is enabled.)
Access a notebook instance from local VS Code and submit training jobs.
Configured as required.
OBS
obs:bucket:ListAllMybuckets
obs:bucket:HeadBucket
obs:bucket:ListBucket
obs:bucket:GetBucketLocation
obs:object:GetObject
obs:object:GetObjectVersion
obs:object:PutObject
obs:object:DeleteObject
obs:object:DeleteObjectVersion
obs:object:ListMultipartUploadParts
obs:object:AbortMultipartUpload
obs:object:GetObjectAcl
obs:object:GetObjectVersionAcl
obs:bucket:PutBucketAcl
obs:object:PutObjectAcl
obs:object:ModifyObjectMetaData
IAM
iam:projects:listProjects
Obtain an IAM project list through local PyCharm for access configurations.
VPC access
VPC
VPC ReadOnlyAccess
Mount an instance to your VPC for access of multiple network planes.
Configured as required.
To define permissions required to access both global and project-level services, enclose the permissions in two separate custom policies for refined authorization.
- Agency
Table 2 Agencies required by development environments Application Scenario
Dependent Service
Agency Authorization
Description
Configuration Suggestion
JupyterLab
OBS
obs:object:DeleteObject
obs:object:GetObject
obs:object:GetObjectVersion
obs:bucket:CreateBucket
obs:bucket:ListBucket
obs:bucket:ListAllMyBuckets
obs:object:PutObject
obs:bucket:GetBucketAcl
obs:bucket:PutBucketAcl
obs:bucket:PutBucketCORS
Use OBS to upload and download data in JupyterLab through ModelArts notebook.
Recommended.
Development environment monitoring
AOM
aom:alarm:put
Call the AOM API to obtain monitoring data and events of notebook instances and display them in ModelArts notebook.
Recommended.
VPC access
VPC
vpc:ports:create
vpc:ports:get
vpc:ports:delete
vpc:subnets:get
Mount an instance to your VPC for access of multiple network planes.
Configured as required.
Procedure
In this example, a notebook instance is used to debug code on a single node with a single PU. The data and code are stored in an OBS parallel file system. After the debugging, you can save the notebook instance as an image.
- Log in to the management console as a tenant user, hover the cursor over your username in the upper right corner, and choose Identity and Access Management from the drop-down list to switch to the IAM management console.
- Add the permissions to use development environments and the permissions of the dependent service SWR. On the IAM console, choose Permissions > Policies/Roles from the navigation pane, click Create Custom Policy in the upper right corner, and configure policies.
- Add the permissions to use development environments.
- Policy Name: Enter a policy name, for example, notebook.
- Policy View: Select JSON.
- Policy Content: Enter the following information:
{ "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "modelarts:notebook:create", "modelarts:notebook:list", "modelarts:notebook:get", "modelarts:notebook:update", "modelarts:notebook:delete", "modelarts:notebook:start", "modelarts:notebook:stop", "modelarts:notebook:updateStopPolicy", "modelarts:notebook:listMountedStorages", "modelarts:notebook:mountStorage", "modelarts:notebook:getMountedStorage", "modelarts:notebook:umountStorage", "modelarts:image:delete", "modelarts:image:list", "modelarts:image:create", "modelarts:image:get", "modelarts:pool:list", "modelarts:tag:list", "modelarts:network:get", "aom:metric:get", "aom:metric:list", "aom:alarm:list" ] } ] }
- Add the permissions to use development environments.
- Add the permissions of the dependent service OBS.
On the IAM console, choose Permissions > Policies/Roles from the navigation pane, click Create Custom Policy in the upper right corner, and configure policies.
- Policy Name: Enter a policy name, for example, notebook-obs.
- Policy View: Select JSON.
- Policy Content: Enter the following information:
{ "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "obs:bucket:ListAllMyBuckets", "obs:bucket:ListBucket" ] } ] }
To define permissions required to access both global and project-level services, enclose the permissions in two separate custom policies for refined authorization. trainJob is for project-level services, and trainJobobs is for global services. Learn more.
- Create a user group and add the required users to the user group. For details, see Step 1 Creating a User Group and Adding Users to the User Group.
- Authorize the policy for the user group. On the user group list page of IAM, click Authorize of the target user group. The Authorize User Group page is displayed. Select notebook, notebook-obs, and SWR Admin. Click Next and then OK.Figure 1 Authorizing a policy to a user group
- Create a ModelArts agency.
- Create an agency authorization policy.
On the IAM console, choose Permissions > Policies/Roles from the navigation pane, click Create Custom Policy in the upper right corner, and configure policies.
- Policy Name: Enter a policy name, for example, ma_agency_obs.
- Policy View: Select JSON.
- Policy Content: Enter the following information:
{ "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "obs:object:GetObject", "obs:object:DeleteObject", "obs:bucket:PutBucketAcl", "obs:object:PutObject", "obs:bucket:CreateBucket", "obs:bucket:GetBucketAcl", "obs:bucket:PutBucketCORS", "obs:bucket:ListAllMyBuckets", "obs:bucket:ListBucket", "obs:object:GetObjectVersion" ] } ] }
- Create an agency.
On the IAM console, choose Agencies from the navigation pane, click Create Agency in the upper right corner, and configure policies. Enter agency information and click Next.
- Agency Name: Customize an agency name, for example, ma_agency_notebook.
- Agency Type: Select Cloud service.
- Cloud Service: Select ModelArts.
- Validity Period: Select Unlimited.
Select the new agency policy and click Next. Set the minimum authorization scope. Select All resources for Scope. Click OK.
- Assign ModelArts permissions for IAM users.
Log in to the ModelArts management console. In the navigation pane on the left, choose Permission Management. On the displayed page, click Add Agency. Set Object Name to the target IAM user and select the created agency. Then, click Create.
Authorization already exists. Updating it will replace the existing one, which may impact your services. This operation cannot be undone.
- Create an agency authorization policy.
- Verify that the permissions are configured.
Log in as the IAM user. If you can create a notebook instance, mount an OBS file system (the OBS bucket must be created by the administrator), and save an image on the console, the agency configuration is successful.
What is your overall rating for this page?
Thank 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