func attachPolicyToUser(conn *iam.IAM, user string, arn string) error { _, err := conn.AttachUserPolicy(&iam.AttachUserPolicyInput{ UserName: aws.String(user), PolicyArn: aws.String(arn), }) if err != nil { return err } return nil }
func attachPolicyToUsers(conn *iam.IAM, users []*string, arn string) error { for _, u := range users { _, err := conn.AttachUserPolicy(&iam.AttachUserPolicyInput{ UserName: u, PolicyArn: aws.String(arn), }) if err != nil { return err } } return nil }