How to attach policy to an IAM user

Use the below command to attach policy to an IAM user where username is the name of the user and ‘arn:aws:iam::123456789123:policy/POLICYNAME’ is the arn of the policy.

aws iam attach-user-policy --user-name username --policy-arn arn:aws:iam::123456789123:policy/POLICYNAME

See also  How to delete an IAM user