假设:
我在账户 A 中创建了 IAM 策略,因为 DynamoDB 特定于 AWS 账户 A。那么,如何使用 AWS CLI 将 IAM 策略附加到用户 X 的 SSO 角色?
你不能。 AWS 不允许您手动更新 SSO 联合角色/用户的策略(显然)。您需要从 IAM Identity Center 更新用户的 SSO 角色权限集。
aws iam attach-role-policy --role-name AWSReservedSSO_xxxxx_xxxxx --policy-arn <policy_arn>
An error occurred (UnmodifiableEntity) when calling the AttachRolePolicy operation:
Cannot perform the operation on the protected role 'AWSReservedSSO_xxxxx_xxxxx' - this role is only modifiable by AWS