github.com/aspring/packer@v0.8.1-0.20150629211158-9db281ac0f89/website/source/docs/builders/digitalocean.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "DigitalOcean Builder"
     4  description: |-
     5    The `digitalocean` Packer builder is able to create new images for use with DigitalOcean. The builder takes a source image, runs any provisioning necessary on the image after launching it, then snapshots it into a reusable image. This reusable image can then be used as the foundation of new servers that are launched within DigitalOcean.
     6  ---
     7  
     8  # DigitalOcean Builder
     9  
    10  Type: `digitalocean`
    11  
    12  The `digitalocean` Packer builder is able to create new images for use with
    13  [DigitalOcean](http://www.digitalocean.com). The builder takes a source
    14  image, runs any provisioning necessary on the image after launching it,
    15  then snapshots it into a reusable image. This reusable image can then be
    16  used as the foundation of new servers that are launched within DigitalOcean.
    17  
    18  The builder does _not_ manage images. Once it creates an image, it is up to
    19  you to use it or delete it.
    20  
    21  ## Configuration Reference
    22  
    23  There are many configuration options available for the builder. They are
    24  segmented below into two categories: required and optional parameters. Within
    25  each category, the available configuration keys are alphabetized.
    26  
    27  In addition to the options listed here, a
    28  [communicator](/docs/templates/communicator.html)
    29  can be configured for this builder.
    30  
    31  ### Required:
    32  
    33  * `api_token` (string) - The client TOKEN to use to access your account.
    34    It can also be specified via environment variable `DIGITALOCEAN_API_TOKEN`, if set.
    35  
    36  * `image` (string) - The name (or slug) of the base image to use. This is the
    37    image that will be used to launch a new droplet and provision it.
    38    See https://developers.digitalocean.com/documentation/v2/#list-all-images for details on how to get a list of the the accepted image names/slugs.
    39  
    40  * `region` (string) - The name (or slug) of the region to launch the droplet in.
    41    Consequently, this is the region where the snapshot will be available.
    42    See https://developers.digitalocean.com/documentation/v2/#list-all-regions for the accepted region names/slugs.
    43  
    44  * `size` (string) - The name (or slug) of the droplet size to use.
    45    See https://developers.digitalocean.com/documentation/v2/#list-all-sizes for the accepted size names/slugs.
    46  
    47  ### Optional:
    48  
    49  * `droplet_name` (string) - The name assigned to the droplet. DigitalOcean
    50    sets the hostname of the machine to this value.
    51  
    52  * `private_networking` (boolean) - Set to `true` to enable private networking
    53    for the droplet being created. This defaults to `false`, or not enabled.
    54  
    55  * `snapshot_name` (string) - The name of the resulting snapshot that will
    56    appear in your account. This must be unique.
    57    To help make this unique, use a function like `timestamp` (see
    58    [configuration templates](/docs/templates/configuration-templates.html) for more info)
    59  
    60  * `state_timeout` (string) - The time to wait, as a duration string,
    61    for a droplet to enter a desired state (such as "active") before
    62    timing out. The default state timeout is "6m".
    63  
    64  * `user_data` (string) - User data to launch with the Droplet.
    65  
    66  ## Basic Example
    67  
    68  Here is a basic example. It is completely valid as soon as you enter your
    69  own access tokens:
    70  
    71  ```javascript
    72  {
    73    "type": "digitalocean",
    74    "api_token": "YOUR API KEY",
    75    "image": "ubuntu-12-04-x64",
    76    "region": "nyc2",
    77    "size": "512mb"
    78  }
    79  ```