更新时间:2026-07-01 GMT+08:00
分享

企业注册表资源

资源是服务中存在的对象。在企业注册表中,资源包括:repository、instance、chart,您可以在创建策略时,通过指定资源路径来选择特定资源。

表1 SWR的指定资源与对应路径

指定资源

资源名称

资源路径

repository

镜像仓库

【格式】

SWR:*:*:repository:注册表名称/命名空间名称/仓库名称

其中第一个*是Regionid,第二个*是domainid。

【说明】

通过注册表名称/命名空间名称/仓库名称指定具体的资源路径,支持通配符*。例如:

  • SWR:*:*:repository:* 表示任意镜像仓库。
  • SWR:*:*:repository:test-instance/*:test-instance 注册表内所有的镜像仓库。
  • SWR:*:*:repository:test-instance/ns/*:test-instance 注册表内,ns命名空间下所有的镜像仓库。
  • SWR:*:*:repository:test-instance/ns/repo*:test-instance 注册表内,ns命名空间下,仓库名称以repo开头的镜像仓库。

instance

注册表实例

【格式】

SWR:*:*:instance:注册表实例。

其中第一个*是Regionid,第二个*是domainid。

【说明】

通过注册表名称指定具体的资源路径,支持通配符*。例如:

SWR:*:*:instance:example-instance表示名称为example-instance注册表实例。

例如只允许用户操作名为“example-instance”的注册表,则可以通过如下方式配置。

{
    "Version": "1.1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "swr:instance:*"
            ],
            "Resource": [
                "SWR:*:*:instance:example-instance"
            ]
        }
    ]
}

相关文档