def create_instance_template(properties, name_prefix):
    """ Creates an instance template resource. """

    name = name_prefix + '-it'

    instance_template = {
        'type': 'instance_template.py',
        'name': name,
        'properties': properties
    }

    self_link = '$(ref.{}.selfLink)'.format(name)

    return self_link, [instance_template], [
        {
            'name': 'instanceTemplateSelfLink',
            'value': self_link
        }
    ]