'Run ``packer build`` using the configuration in the supplied ``intent``
and parse its output.
:returns: A ``Deferred`` which fires with a dict mapping the ID of the
AMI published to each AWS region.'

@deferred_performer
def perform_packer_build(self, dispatcher, intent):

    command = [PACKER_PATH.path, 'build', '-machine-readable', intent.configuration_path.path]
    parser = _PackerOutputParser()
    def handle_stdout(line):
        parser.parse_line(line)
        self.sys_module.stderr.write((line + '\n'))
    d = run(self.reactor, command, handle_stdout=handle_stdout)
    d.addCallback((lambda ignored: parser.packer_amis()))
    return d
