func iamPolicyListVersions(arn string, iamconn *iam.IAM) ([]*iam.PolicyVersion, error) { request := &iam.ListPolicyVersionsInput{ PolicyARN: aws.String(arn), } response, err := iamconn.ListPolicyVersions(request) if err != nil { return nil, fmt.Errorf("Error listing versions for IAM policy %s: %s", arn, err) } return response.Versions, nil }