def group_iam_policies_by_targets(policies):
    """ Groups the collection of IAM actions by target. """

    policies_by_targets = {}
    for policy in policies:
        target = policy['properties']['resource']
        if not target in policies_by_targets:
            policies_by_targets[target] = []
        policies_by_targets[target].append(policy)

    return policies_by_targets