func GetGroupPoliciesMapForGroup(groupname *string, svc *iam.Client) map[string]string {
	result := make(map[string]string)
	params := &iam.ListGroupPoliciesInput{
		GroupName: groupname,
	}
	resp, err := svc.ListGroupPolicies(context.TODO(), params)
	if err != nil {
		panic(err)
	}
	if len(resp.PolicyNames) > 0 {
		for _, policyname := range resp.PolicyNames {
			params := &iam.GetGroupPolicyInput{
				PolicyName: aws.String(policyname),
				GroupName:  groupname,
			}
			resp, err := svc.GetGroupPolicy(context.TODO(), params)
			if err != nil {
				panic(err)
			}
			policyDocument, err := url.QueryUnescape(*resp.PolicyDocument)
			if err != nil {
				panic(err)
			}
			result[policyname] = policyDocument
		}
	}
	return result
}
// GetGroupPoliciesMapForGroup retrieves a map of policies for the provided IAM
// groupname where the key is the name of the policy and the value is the actual
// json policy document
GetGroupPoliciesMapForGroup retrieves a map of policies for the provided IAM
groupname where the key is the name of the policy and the value is the actual
json policy document
// GetGroupPoliciesMapForGroup retrieves a map of policies for the provided IAM // groupname where the key is the name of the policy and the value is the actual // json policy document
func GetGroupPoliciesMapForGroup(groupname *string, svc *iam.Client) map[string]string {
	result := make(map[string]string)
	params := &iam.ListGroupPoliciesInput{
		GroupName: groupname,
	}
	resp, err := svc.ListGroupPolicies(context.TODO(), params)
	if err != nil {
		panic(err)
	}
	if len(resp.PolicyNames) > 0 {
		for _, policyname := range resp.PolicyNames {
			params := &iam.GetGroupPolicyInput{
				PolicyName: aws.String(policyname),
				GroupName:  groupname,
			}
			resp, err := svc.GetGroupPolicy(context.TODO(), params)
			if err != nil {
				panic(err)
			}
			policyDocument, err := url.QueryUnescape(*resp.PolicyDocument)
			if err != nil {
				panic(err)
			}
			result[policyname] = policyDocument
		}
	}
	return result
}
func GetGroupPoliciesMapForGroup ( groupname * string , svc * iam . Client ) map [ string ] string { result := make ( map [ string ] string ) params := & iam . ListGroupPoliciesInput { GroupName : groupname , } resp , err := svc . ListGroupPolicies ( context . TODO ( ) , params ) if err != nil { panic ( err ) } if len ( resp . PolicyNames ) > 0 { for _ , policyname := range resp . PolicyNames { params := & iam . GetGroupPolicyInput { PolicyName : aws . String ( policyname ) , GroupName : groupname , } resp , err := svc . GetGroupPolicy ( context . TODO ( ) , params ) if err != nil { panic ( err ) } policyDocument , err := url . QueryUnescape ( * resp . PolicyDocument ) if err != nil { panic ( err ) } result [ policyname ] = policyDocument } } return result }
GetGroupPoliciesMapForGroup retrieves a map of policies for the provided IAM
groupname where the key is the name of the policy and the value is the actual
json policy document
GetGroupPoliciesMapForGroup retrieves a map of policies for the provided IAM groupname where the key is the name of the policy and the value is the actual json policy document