Avant d'utiliser un utilisateur RAM pour appeler les opérations API Alibaba Cloud, vous devez utiliser un compte Alibaba Cloud pour créer une politique d'autorisation afin d'accorder des permissions à l'utilisateur RAM.
Autorisation des ressources
Par défaut, un utilisateur RAM n'est pas autorisé à appeler les opérations API Alibaba Cloud. Avant d'utiliser un utilisateur RAM pour appeler les opérations API Alibaba Cloud, vous devez accorder à l'utilisateur RAM les permissions sur les opérations API que vous souhaitez appeler. Pour accorder des permissions à un utilisateur RAM, vous devez créer et attacher une politique d'autorisation à l'utilisateur RAM.
Lors de la création de la politique d'autorisation, vous pouvez utiliser un Alibaba Cloud Resource Name (ARN) pour spécifier la ressource sur laquelle vous souhaitez accorder des permissions. Un ARN est un nom globalement unique utilisé pour identifier une ressource sur Alibaba Cloud. Un ARN respecte le format suivant :
acs:service-name:region:account-id:resource-relative-id
Un ARN contient les champs suivants :
acs : forme abrégée d'Alibaba Cloud Service. Cela indique que le service est une offre de cloud public d'Alibaba Cloud.
service-name : nom d'un service Alibaba Cloud, tel que Elastic Compute Service (ECS), Object Storage Service (OSS) et Resource Orchestration Service (ROS).
region : région où réside un service. Si cette option n'est pas prise en charge, utilisez l'astérisque (
*) à la place.account-id : ID de votre compte Alibaba Cloud, par exemple 123456789012****.
-
resource-relative-id : description de la ressource. La description varie selon le service. Pour plus d'informations, consultez la documentation du service Alibaba Cloud que vous souhaitez utiliser.
Par exemple,
acs:oss:*:123456789012****:sample_bucket/file1.txtindique une ressource nommée sample_bucket/file1.txt dans OSS, et123456789012****indique l'ID de l'utilisateur auquel appartient la ressource.
Types de ressources ROS pouvant être autorisés
Type de ressource | Format ARN dans la politique d'autorisation |
Stack | acs:ros:$regionid:$accountid:stack/$stackid |
acs:ros:$regionid:$accountid:stack/* | |
Template | acs:ros:$regionid:$accountid:template/$templateid |
acs:ros:$regionid:$accountid:template/* | |
StackGroup | acs:ros:$regionid:$accountid:stack_group/* |
Opérations API ROS pouvant être autorisées
-
Opérations de stack
API
Action
Format ARN
PreviewStack
ros:PreviewStack
acs:ros:cn-hangzhou:$accountid:stack/*
CreateStack
ros:CreateStack
cs:ros:cn-hangzhou:$accountid:stack/*
ContinueCreateStack
ros:ContinueCreateStack
acs:ros:cn-hangzhou:$accountid:stack/$stackid
SetDeletionProtection
ros:SetDeletionProtection
acs:ros:cn-hangzhou:$accountid:stack/$stackid
UpdateStack
ros:UpdateStack
acs:ros:cn-hangzhou:$accountid:stack/$stackid
CancelUpdateStack
ros:CancelUpdateStack
acs:ros:cn-hangzhou:$accountid:stack/$stackid
GetStack
ros:GetStack
acs:ros:cn-hangzhou:$accountid:stack/$stackid
ListStacks
ros:ListStacks
acs:ros:cn-hangzhou:$accountid:stack/*
ListStackEvents
ros:ListStackEvents
acs:ros:cn-hangzhou:$accountid:stack/$stackid
ListStackOperationRisks
ros:ListStackOperationRisks
acs:ros:cn-hangzhou:$accountid:stack/$stackid
DeleteStack
ros:DeleteStack
acs:ros:cn-hangzhou:$accountid:stack/$stackid
CreateChangeSet
ros:CreateChangeSet
Lorsque ChangeSetType est défini sur CREATE : acs:ros:cn-hangzhou:$accountid:stack/*
Lorsque ChangeSetType est défini sur UPDATE : acs:ros:cn-hangzhou:$accountid:stack/$stackid
Lorsque ChangeSetType est défini sur IMPORT : acs:ros:cn-hangzhou:$accountid:stack/*
ExecuteChangeSet
ros:ExecuteChangeSet
acs:ros:cn-hangzhou:$accountid:stack/$stackid
GetChangeSet
ros:GetChangeSet
acs:ros:cn-hangzhou:$accountid:stack/$stackid
ListChangeSets
ros:ListChangeSets
acs:ros:cn-hangzhou:$accountid:stack/$stackid
DeleteChangeSet
ros:DeleteChangeSet
acs:ros:cn-hangzhou:$accountid:stack/$stackid
-
Opérations de ressource
API
Action
Format ARN
GetResourceTypeTemplate
ros:GetResourceTypeTemplate
Aucune authentification requise
ListStackResources
ros:ListStackResources
acs:ros:cn-hangzhou:$accountid:stack/$stackid
GetStackResource
ros:GetStackResource
acs:ros:cn-hangzhou:$accountid:stack/$stackid
GetResourceType
ros:GetResourceType
Aucune authentification requise
ListResourceTypes
ros:ListResourceTypes
Aucune authentification requise
MoveResourceGroup
ros:MoveResourceGroup
Lorsque ResourceType est défini sur stack : acs:ros:cn-hangzhou:$accountid:stack/*
Lorsque ResourceType est défini sur stackgroup : acs:ros:cn-hangzhou:$accountid:stack_group/*
Lorsque ResourceType est défini sur template : acs:ros:cn-hangzhou:$accountid:template/*
-
Opérations de groupe de stacks
|
**API**
|
**Action**
|
**Format ARN**
| | --- | --- | --- | |
CreateStackGroup
|
ros:CreateStackGroup
|
acs:ros:cn-hangzhou:$accountid:stack_group/*
| |
UpdateStackGroup
|
ros:UpdateStackGroup
|
acs:ros:cn-hangzhou:$accountid:stack_group/*
| |
GetStackGroup
|
ros:GetStackGroup
|
acs:ros:cn-hangzhou:$accountid:stack_group/*
| |
ListStackGroups
|
ros:ListStackGroups
|
acs:ros:cn-hangzhou:$accountid:stack_group/*
| |
DeleteStackGroup
|
ros:DeleteStackGroup
|
acs:ros:cn-hangzhou:$accountid:stack_group/*
| |
CreateStackInstances
|
ros:CreateStackInstances
|
acs:ros:cn-hangzhou:$accountid:stack_instance/*
| |
UpdateStackInstances
|
ros:UpdateStackInstances
|
acs:ros:cn-hangzhou:$accountid:stack_instance/*
| |
GetStackInstance
|
ros:GetStackInstance
|
acs:ros:cn-hangzhou:$accountid:stack_instance/*
| |
ListStackInstances
|
ros:ListStackInstances
|
acs:ros:cn-hangzhou:$accountid:stack_instance/*
| |
DeleteStackInstances
|
ros:DeleteStackInstances
|
acs:ros:cn-hangzhou:$accountid:stack_instance/*
| |
GetStackGroupOperation
|
ros:GetStackGroupOperation
|
acs:ros:cn-hangzhou:$accountid:stack_group_operation/*
| |
ListStackGroupOperations
|
ros:ListStackGroupOperations
|
acs:ros:cn-hangzhou:$accountid:stack_group_operation/*
| |
ListStackGroupOperationResults
|
ros:ListStackGroupOperationResults
|
acs:ros:cn-hangzhou:$accountid:stack_group_operation/*
| |
StopStackGroupOperation
|
ros:StopStackGroupOperation
|
acs:ros:cn-hangzhou:$accountid:stack_group_operation/*
| -
Opérations de modèle
API
Action
Format ARN
GenerateTemplatePolicy
ros:GenerateTemplatePolicy
acs:ros:cn-hangzhou:$accountid:template/$templateid
RemarqueSi le paramètre TemplateId est spécifié, une authentification est requise.
CreateTemplate
ros:CreateTemplate
acs:ros:cn-hangzhou:$accountid:template/*
ValidateTemplate
ros:ValidateTemplate
Aucune authentification requise
UpdateTemplate
ros:UpdateTemplate
acs:ros:cn-hangzhou:$accountid:template/$templateid
GetTemplate
ros:GetTemplate
acs:ros:cn-hangzhou:$accountid:stack/$stackid
acs:ros:$regionid:$accountid:stack_group/*
acs:ros:cn-hangzhou:$accountid:template/$templateid
GetTemplateEstimateCost
ros:GetTemplateEstimateCost
acs:ros:cn-hangzhou:$accountid:*
GetTemplateSummary
ros:GetTemplateSummary
acs:ros:cn-hangzhou:$accountid:template/$templateid
RemarqueSi le paramètre TemplateId est spécifié, une authentification est requise.
ListTemplates
ros:ListTemplates
acs:ros:cn-hangzhou:$accountid:template/*
ListTemplateVersions
ros:ListTemplateVersions
acs:ros:cn-hangzhou:$accountid:template/$templateid
SetTemplatePermission
ros:SetTemplatePermission
acs:ros:cn-hangzhou:$accountid:*
DeleteTemplate
ros:DeleteTemplate
acs:ros:cn-hangzhou:$accountid:template/$templateid
-
Opérations de tag
|
**API**
|
**Action**
|
**Format ARN**
| | --- | --- | --- | |
ListTagResources
|
ros:ListTagResources
|
acs:ros:cn-hangzhou:$accountid:tag/*
| |
ListTagKeys
|
ros:ListTagKeys
|
acs:ros:cn-hangzhou:$accountid:tag/*
| |
ListTagValues
|
ros:ListTagValues
|
acs:ros:cn-hangzhou:$accountid:tag/*
| |
UntagResources
|
ros:UntagResources
|
acs:ros:cn-hangzhou:$accountid:tag/*
| -
Autres opérations
|
**API**
|
**Action**
|
**Format ARN**
| | --- | --- | --- | |
DescribeRegions
|
ros:DescribeRegions
|
Aucune authentification requise
| |
SignalResource
|
ros:SignalResource
|
acs:ros:cn-hangzhou:$accountid:stack/$stackid
| |
GetStackPolicy
|
ros:GetStackPolicy
|
acs:ros:cn-hangzhou:$accountid:stack/$stackid
| |
SetStackPolicy
|
ros:SetStackPolicy
|
acs:ros:cn-hangzhou:$accountid:stack/$stackid
|