Use the below command to attach a policy to an IAM group where TeamA is the group name and ‘arn:aws:iam::123456789123:policy/POLICYNAME’ is the policy arn.
aws iam attach-group-policy --group-name TeamA --policy-arn arn:aws:iam::123456789123:policy/POLICYNAME