访问控制(RAM)是阿里云提供的管理用户身份与资源访问权限的服务。使用RAM可以让您避免与其他用户共享阿里云账号密钥,并可按需为用户授予最小权限。RAM中使用获取最小权限策略描述授权的具体内容。

本文为您介绍容器镜像服务(cr)为RAM权限策略定义的操作(Action)、资源(Resource)和条件(Condition)。容器镜像服务(cr)的RAM代码(RamCode)为 cr,支持的授权粒度为资源级

权限策略通用结构

权限策略支持JSON格式,其通用结构如下:展开详情

操作(Action)

下表是容器镜像服务(cr)定义的操作,这些操作可以在RAM权限策略语句的Action元素中使用,用来授予执行该操作的权限。下面对表中的具体项提供说明:展开详情

操作API访问级别资源类型条件关键字关联操作
cr:BuildRepositoryByRecord
根据已有构建记录重新构建记录
Create
Repository
acs:cr:{#regionId}:{#accountId}:repository/{#InstanceId}/{#NamespaceName}/{#RepositoryName}
cr:BuildRepositoryByRule
根据规则创建构建记录
Create
Repository
acs:cr:{#regionId}:{#accountId}:repository/{#instanceid}/{#namespacename}/{#repositoryname}
cr:CancelArtifactBuildTask
取消制品的构建任务
Delete
Instance
acs:cr:{#regionId}:{#accountId}:instance/{#instanceid}
cr:CancelArtifactDeleteUntaggedManifestTask
Write
全部资源
*
cr:CancelBuildRepository
取消仓库构建
Delete
Repository
acs:cr:{#regionId}:{#accountId}:repository/{#InstanceId}/{#NamespaceName}/{#RepositoryName}
cr:CancelDiagnosisTask
Update
全部资源
*
cr:CancelInstanceImageMigrateTask
Write
Instance
acs:cr:{#regionId}:{#accountId}:repository/{#InstanceId}
cr:CancelRepoSyncTask
取消单个同步任务
Update
Repository
acs:cr:{#regionId}:{#accountId}:repository/{#instanceid}
cr:ChangeResourceGroup
修改资源所属的资源组信息
Update
Instance
acs:cr:{#regionId}:{#accountId}:instance/{#InstanceId}
cr:CreateAccessVpcLink
Write
Instance
acs:cr:{#regionId}:{#accountId}:instance/{#InstanceId}
资源(Resource)

下表是容器镜像服务(cr)定义的资源,这些资源可以在RAM权限策略语句的Resource元素中使用,用来授予对该资源执行具体操作的权限。

其中,资源ARN是资源在阿里云上的唯一标识。具体说明如下:

  • {#}为变量标识,需要您替换为实际值。例如: {#ramcode} 需要您替换为实际的云服务RAM代码。
  • *表示全部。例如:
    • {#resourceType}/* :表示全部资源。
    • {#regionId}*时:表示全部地域。
    • {#accountId}*时:表示全部阿里云账号。
资源类型资源ARN
ChartNamespace
  • acs:cr:{#regionId}:{#accountId}:chart/{#Instanceid}
  • acs:cr:{#regionId}:{#accountId}:chart/{#NamespaceName}
ChartRepository
  • acs:cr:{#regionId}:{#accountId}:chart/{#instanceid}/{#namespacename}/{#repositoryname}
  • acs:cr:{#regionId}:{#accountId}:chart/{#instanceid}/{#namespacename}
  • acs:cr:{#regionId}:{#accountId}:chart/{#Instanceid}
  • acs:cr:{#regionId}:{#accountId}:chart/{#Instanceid}/*
DiagnosisTask
  • acs:cr:{#regionId}:{#accountId}:diagnosistask/{#instanceid}
Instance
  • acs:cr:{#regionId}:{#accountId}:instance/{#InstanceId}
  • acs:cr:{#regionId}:{#accountId}:instance/*
  • acs:cr:{#regionId}:{#accountId}:repository/{#InstanceId}
  • acs:cr:{#regionId}:{#accountId}:repository/*
Namespace
  • acs:cr:{#regionId}:{#accountId}:chart/{#InstanceId}/{#NamespaceName}
  • acs:cr:{#regionId}:{#accountId}:repository/{#InstanceId}/{#NamespaceName}
RepoSourceCodeRepo
  • acs:cr:{#regionId}:{#accountId}:repository/{#InstanceId}/{#NamespaceName}/{#RepositoryName}
Repository
  • acs:cr:{#regionId}:{#accountId}:repository/{#Instanceid}/{#Namespacename}/{#Repositoryname}
  • acs:cr:{#regionId}:{#accountId}:repository/{#InstanceId}
  • acs:cr:{#regionId}:{#accountId}:repository/{#Instanceid}/{#namespace}/{#repositoryname}
  • acs:cr:{#regionId}:{#accountId}:repository/{#Instanceid}/{#Namespacename}/*
  • acs:cr:{#regionId}:{#accountId}:repository/{#RepositoryId}
  • acs:cr:{#regionId}:{#accountId}:repository/{#instanceid}/{#namespacename}
  • acs:cr:{#regionId}:{#accountId}:chart/{#InstanceId}/{#NamespaceName}/{#RepositoryName}
条件(Condition)

容器镜像服务(cr)未定义产品级别的条件关键字。如需查看适用于所有云产品的通用条件关键字,请参见通用条件关键字

相关操作

您可以创建自定义权限策略,并将权限策略授予RAM用户、RAM用户组或RAM角色。具体操作如下: