'Copy the prototype configuration files and provisioning scripts to a
temporary location and modify one of the configurations with the values
found in ``intent``.'

@sync_performer
def perform_packer_configure(self, dispatcher, intent):

    temporary_configuration_directory = self.working_directory.child('packer_configuration')
    temporary_configuration_directory.makedirs()
    intent.configuration_directory.copyTo(temporary_configuration_directory)
    template_name = u'template_{distribution}_{template}.json'.format(distribution=DEFAULT_DISTRIBUTION, template=intent.template)
    template_path = temporary_configuration_directory.child(template_name)
    with template_path.open('r') as infile:
        configuration = json.load(infile)
    configuration['builders'][0]['region'] = intent.build_region
    configuration['builders'][0]['source_ami'] = intent.source_ami_map[intent.build_region]
    configuration['builders'][0]['ami_regions'] = thaw(intent.publish_regions)
    output_template_path = template_path.temporarySibling()
    with output_template_path.open('w') as outfile:
        _json_dump(configuration, outfile)
    output_template_path.alwaysCreate = False
    return output_template_path
