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 send a message to an SQS queue using Lambda when a file is uploaded to an S3 bucket