全部產品
Search
文件中心

:RAM鑒權

更新時間:Jun 08, 2024

在RAM使用者調用API前,需要阿里雲帳號通過建立授權策略對RAM使用者進行授權。

資源授權

預設情況下,RAM使用者沒有許可權通過調用API去建立、修改阿里雲資源。RAM使用者調用API時,需要先建立一個授權策略,然後將這個授權策略關聯給對應的RAM使用者以完成資源授權。

在建立授權策略時,您可以通過資源描述符ARN(Alibaba Cloud Resource Name)指定要授權的資源。ARN是阿里雲為每個資源定義的一個全域的阿里雲資源名稱。ARN格式如下:
acs:service-name:region:account-id:resource-relative-id
ARN欄位含義如下:
  • acs:Alibaba Cloud Service的首字母縮寫,表示阿里雲的公用雲平台。
  • service-name:阿里雲服務的名稱,例如:ECS、OSS、ROS等。
  • region:地區資訊。如果不支援該項,可以使用萬用字元星號(*)來代替。

  • account-id:阿里雲帳號ID,例如:123456789012****。
  • resource-relative-id:具體的資源描述,不同的阿里雲服務的資源描述也不同。更多資訊,請參見各阿里雲服務的開發文檔。

    例如:acs:oss:*:123456789012****:sample_bucket/file1.txt表示OSS服務中對象名稱是sample_bucket/file1.txt的資源,對象的所有者UID為123456789012****

可授權的Resource Orchestration Service資源類型

資源類型授權策略中的資源描述方法
Stackacs:ros:$regionid:$accountid:stack/$stackid
acs:ros:$regionid:$accountid:stack/*
Templateacs:ros:$regionid:$accountid:template/$templateid
acs:ros:$regionid:$accountid:template/*
StackGroupacs:ros:$regionid:$accountid:stack_group/*

可授權的Resource Orchestration Service介面

  • 資源棧相關介面
    APIAction資源描述
    PreviewStackros:PreviewStackacs:ros:cn-hangzhou:$accountid:stack/*
    CreateStackros:CreateStackcs:ros:cn-hangzhou:$accountid:stack/*
    ContinueCreateStackros:ContinueCreateStackacs:ros:cn-hangzhou:$accountid:stack/$stackid
    SetDeletionProtectionros:SetDeletionProtectionacs:ros:cn-hangzhou:$accountid:stack/$stackid
    UpdateStackros:UpdateStackacs:ros:cn-hangzhou:$accountid:stack/$stackid
    CancelUpdateStackros:CancelUpdateStackacs:ros:cn-hangzhou:$accountid:stack/$stackid
    GetStackros:GetStackacs:ros:cn-hangzhou:$accountid:stack/$stackid
    ListStacksros:ListStacksacs:ros:cn-hangzhou:$accountid:stack/*
    ListStackEventsros:ListStackEventsacs:ros:cn-hangzhou:$accountid:stack/$stackid
    ListStackOperationRisksros:ListStackOperationRisksacs:ros:cn-hangzhou:$accountid:stack/$stackid
    DeleteStackros:DeleteStackacs:ros:cn-hangzhou:$accountid:stack/$stackid
    CreateChangeSetros:CreateChangeSet
    • 當ChangeSetType取值為CREATE時:acs:ros:cn-hangzhou:$accountid:stack/*
    • 當ChangeSetType取值為UPDATE時:acs:ros:cn-hangzhou:$accountid:stack/$stackid
    • 當ChangeSetType取值為IMPORT時:acs:ros:cn-hangzhou:$accountid:stack/*
    ExecuteChangeSetros:ExecuteChangeSetacs:ros:cn-hangzhou:$accountid:stack/$stackid
    GetChangeSetros:GetChangeSetacs:ros:cn-hangzhou:$accountid:stack/$stackid
    ListChangeSetsros:ListChangeSetsacs:ros:cn-hangzhou:$accountid:stack/$stackid
    DeleteChangeSetros:DeleteChangeSetacs:ros:cn-hangzhou:$accountid:stack/$stackid
  • 資源相關介面
    APIAction資源描述
    GetResourceTypeTemplateros:GetResourceTypeTemplate不鑒權
    ListStackResourcesros:ListStackResourcesacs:ros:cn-hangzhou:$accountid:stack/$stackid
    GetStackResourceros:GetStackResourceacs:ros:cn-hangzhou:$accountid:stack/$stackid
    GetResourceTyperos:GetResourceType不鑒權
    ListResourceTypesros:ListResourceTypes不鑒權
    MoveResourceGroupros:MoveResourceGroup
    • 當ResourceType取值為stack時:acs:ros:cn-hangzhou:$accountid:stack/*
    • 當ResourceType取值為stackgroup時:acs:ros:cn-hangzhou:$accountid:stack_group/*
    • 當ResourceType取值為template時:acs:ros:cn-hangzhou:$accountid:template/*
  • 資源棧組相關介面
    APIAction資源描述
    CreateStackGroupros:CreateStackGroupacs:ros:cn-hangzhou:$accountid:stack_group/*
    UpdateStackGroupros:UpdateStackGroupacs:ros:cn-hangzhou:$accountid:stack_group/*
    GetStackGroupros:GetStackGroupacs:ros:cn-hangzhou:$accountid:stack_group/*
    ListStackGroupsros:ListStackGroupsacs:ros:cn-hangzhou:$accountid:stack_group/*
    DeleteStackGroupros:DeleteStackGroupacs:ros:cn-hangzhou:$accountid:stack_group/*
    CreateStackInstancesros:CreateStackInstancesacs:ros:cn-hangzhou:$accountid:stack_instance/*
    UpdateStackInstancesros:UpdateStackInstancesacs:ros:cn-hangzhou:$accountid:stack_instance/*
    GetStackInstanceros:GetStackInstanceacs:ros:cn-hangzhou:$accountid:stack_instance/*
    ListStackInstancesros:ListStackInstancesacs:ros:cn-hangzhou:$accountid:stack_instance/*
    DeleteStackInstancesros:DeleteStackInstancesacs:ros:cn-hangzhou:$accountid:stack_instance/*
    GetStackGroupOperationros:GetStackGroupOperationacs:ros:cn-hangzhou:$accountid:stack_group_operation/*
    ListStackGroupOperationsros:ListStackGroupOperationsacs:ros:cn-hangzhou:$accountid:stack_group_operation/*
    ListStackGroupOperationResultsros:ListStackGroupOperationResultsacs:ros:cn-hangzhou:$accountid:stack_group_operation/*
    StopStackGroupOperationros:StopStackGroupOperationacs:ros:cn-hangzhou:$accountid:stack_group_operation/*
  • 模板相關介面
    APIAction資源描述
    GenerateTemplatePolicyros:GenerateTemplatePolicyacs:ros:cn-hangzhou:$accountid:template/$templateid
    說明 如果指定參數TemplateId,則需要鑒權。
    CreateTemplateros:CreateTemplateacs:ros:cn-hangzhou:$accountid:template/*
    ValidateTemplateros:ValidateTemplate不鑒權
    UpdateTemplateros:UpdateTemplateacs:ros:cn-hangzhou:$accountid:template/$templateid
    GetTemplateros:GetTemplate
    • acs:ros:cn-hangzhou:$accountid:stack/$stackid
    • acs:ros:$regionid:$accountid:stack_group/*
    • acs:ros:cn-hangzhou:$accountid:template/$templateid
    GetTemplateEstimateCostros:GetTemplateEstimateCostacs:ros:cn-hangzhou:$accountid:*
    GetTemplateSummaryros:GetTemplateSummaryacs:ros:cn-hangzhou:$accountid:template/$templateid
    說明 如果指定參數TemplateId,則需要鑒權。
    ListTemplatesros:ListTemplatesacs:ros:cn-hangzhou:$accountid:template/*
    ListTemplateVersionsros:ListTemplateVersionsacs:ros:cn-hangzhou:$accountid:template/$templateid
    SetTemplatePermissionros:SetTemplatePermissionacs:ros:cn-hangzhou:$accountid:*
    DeleteTemplateros:DeleteTemplateacs:ros:cn-hangzhou:$accountid:template/$templateid
  • 標籤相關介面
    APIAction資源描述
    ListTagResourcesros:ListTagResourcesacs:ros:cn-hangzhou:$accountid:tag/*
    ListTagKeysros:ListTagKeysacs:ros:cn-hangzhou:$accountid:tag/*
    ListTagValuesros:ListTagValuesacs:ros:cn-hangzhou:$accountid:tag/*
    UntagResourcesros:UntagResourcesacs:ros:cn-hangzhou:$accountid:tag/*
  • 其他介面
    APIAction資源描述
    DescribeRegionsros:DescribeRegions不鑒權
    SignalResourceros:SignalResourceacs:ros:cn-hangzhou:$accountid:stack/$stackid
    GetStackPolicyros:GetStackPolicyacs:ros:cn-hangzhou:$accountid:stack/$stackid
    SetStackPolicyros:SetStackPolicyacs:ros:cn-hangzhou:$accountid:stack/$stackid