You can attach the specified managed policy to the specified IAM group. You need to use the API to attach a managed policy to a group. To embed an inline policy in a group, use PutGroupPolicy. The following attach-group-policy command attaches the AWS managed policy named ReadOnlyAccess to the IAM group named Finance.
$ aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess --group-name Finance