github.com/phobos182/packer@v0.2.3-0.20130819023704-c84d2aeffc68/website/source/docs/templates/builders.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  ---
     4  
     5  # Templates: Builders
     6  
     7  Within the template, the builders section contains an array of all the
     8  builders that Packer should use to generate a machine images for the template.
     9  
    10  Builders are responsible for creating machines and generating images from
    11  them for various platforms. For example, there are separate builders for
    12  EC2, VMware, VirtualBox, etc. Packer comes with many builders by default,
    13  and can also be extended to add new builders.
    14  
    15  This documentation page will cover how to configure a builder in a template.
    16  The specific configuration options available for each builder, however,
    17  must be referenced from the documentation for that specific builder.
    18  
    19  Within a template, a section of builder definitions looks like this:
    20  
    21  <pre class="prettyprint">
    22  {
    23    "builders": [
    24      ... one or more builder definitions here ...
    25    ]
    26  }
    27  </pre>
    28  
    29  ## Builder Definition
    30  
    31  A single builder definition maps to exactly one [build](/docs/basics/terminology.html#term-build).
    32  A builder definition is a JSON object that requires at least a `type` key. The
    33  `type` is the name of the builder that will be used to create a machine image
    34  for the build.
    35  
    36  In addition to the `type`, other keys configure the builder itself. For
    37  example, the AWS builder requires an `access_key`, `secret_key`, and
    38  some other settings. These are placed directly within the builder definition.
    39  
    40  An example builder definition is shown below, in this case configuring
    41  the AWS builder:
    42  
    43  <pre class="prettyprint">
    44  {
    45    "type": "amazon-ebs",
    46    "access_key": "...",
    47    "secret_key": "..."
    48  }
    49  </pre>
    50  
    51  ## Named Builds
    52  
    53  Each build in Packer has a name. By default, the name is just the name
    54  of the builder being used. In general, this is good enough. Names only serve
    55  as an indicator in the output of what is happening. If you want, however,
    56  you can specify a custom name using the `name` key within the builder definition.
    57  
    58  This is particularly useful if you have multiple builds defined that use
    59  the same underlying builder. In this case, you must specify a name for at least
    60  one of them since the names must be unique.