授权子账号拥有CVM相关资源的只读权限

最近更新时间: 2024-10-17 17:10:00

授权子账号拥有CVM相关资源的只读权限

企业帐号CompanyExample(ownerUin为12345678)下有一个子账号Developer,该子账号需要拥有对企业帐号CompanyExample的CVM服务的查询 CVM 实例及相关资源(VPC 、CLB)的权限,但是不具有创建、删除、开关机的权限。

方案A:

企业帐号CompanyExample直接将预设策略QcloudCVMReadOnlyAccess授权给子账号Develope

方案B:

step1:通过策略语法方式创建以下策略

{
    "version": "2.0",
    "statement": [
        {
            "action": [
                "cvm:Describe*",
                "cvm:Inquiry*"
            ],
            "resource": "*",
            "effect": "allow"
        },
        {
            "action": [
                "vpc:Describe*",
                "vpc:Inquiry*",
                "vpc:Get*"
            ],
            "resource": "*",
            "effect": "allow"
        },
        {
            "action": [
                "clb:Describe*"
            ],
            "resource": "*",
            "effect": "allow"
        },
        {
            "effect": "allow",
            "action": "monitor:*",
            "resource": "*"
        }
    ]
}

step2:将该策略授权给子账号。