场景:主账号为运维同事创建了 CAM 子账号,并授予了自定义策略,希望只允许查看和重启指定地域的 CVM 实例。子账号用 SecretId/SecretKey 通过腾讯云 Python SDK 调用 DescribeInstances 时正常,但调用 RebootInstances 时返回错误。 环境:Python 3.10,tencentcloud-sdk-python 3.0.x,地域 ap-guangzhou,策略为自定义 JSON 策略,资源描述使用 qcs::cvm:ap-guangzhou:uin/主账号UIN:instance/*。 报错原文:[TencentCloudSDKException] code:UnauthorizedOperation message:You are not authorized to perform operation (cvm:RebootInstances) resource (qcs::cvm:ap-guangzhou:uin/xxxx:instance/ins-xxxx) has no permission. 已尝试: 1. 在策略语法中确认 action 写了 cvm:RebootInstances,effect 为 allow。 2. 用策略模拟器测试,结果显示允许,但真实调用仍被拒绝。 3. 怀疑与标签鉴权或用户组策略中存在显式拒绝有关,但不知道如何定位。 想请教: 1. 策略模拟器通过而真实调用被拒绝,常见原因有哪些? 2. 如何确认是否存在显式 deny 或标签条件(qcs:tag)导致的拒绝? 3. 有没有推荐的最小权限写法,只允许重启指定标签的实例?
相似问题