Reputation: 22356
Suppose:
I created the IAM policy in the Account A because the DynamoDB is specific to the AWS account A. Then, how can attach the IAM policy to the SSO role for user X using AWS CLI?
Upvotes: 0
Views: 211
Reputation: 814
You can't. AWS won't allow you to manually update the policy of SSO federated roles/users (obviously). You need to update the user's SSO role permission set from IAM Identity Center.
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
Upvotes: 1