github.com/supr/packer@v0.3.10-0.20131015195147-7b09e24ac3c1/website/source/docs/builders/digitalocean.html.markdown (about) 1 --- 2 layout: "docs" 3 --- 4 5 # DigitalOcean Builder 6 7 Type: `digitalocean` 8 9 The `digitalocean` builder is able to create new images for use with 10 [DigitalOcean](http://www.digitalocean.com). The builder takes a source 11 image, runs any provisioning necessary on the image after launching it, 12 then snapshots it into a reusable image. This reusable image can then be 13 used as the foundation of new servers that are launched within DigitalOcean. 14 15 The builder does _not_ manage images. Once it creates an image, it is up to 16 you to use it or delete it. 17 18 ## Configuration Reference 19 20 There are many configuration options available for the builder. They are 21 segmented below into two categories: required and optional parameters. Within 22 each category, the available configuration keys are alphabetized. 23 24 Required: 25 26 * `api_key` (string) - The API key to use to access your account. You can 27 retrieve this on the "API" page visible after logging into your account 28 on DigitalOcean. Alternatively, the builder looks for the environment 29 variable `DIGITALOCEAN_API_KEY`. 30 31 * `client_id` (string) - The client ID to use to access your account. You can 32 find this on the "API" page visible after logging into your account on 33 DigitalOcean. Alternatively, the builder looks for the environment 34 variable `DIGITALOCEAN_CLIENT_ID`. 35 36 Optional: 37 38 * `image_id` (int) - The ID of the base image to use. This is the image that 39 will be used to launch a new droplet and provision it. Defaults to "284203", 40 which happens to be "Ubuntu 12.04 x64 Server." 41 42 * `region_id` (int) - The ID of the region to launch the droplet in. Consequently, 43 this is the region where the snapshot will be available. This defaults to 44 "1", which is "New York." 45 46 * `size_id` (int) - The ID of the droplet size to use. This defaults to "66," 47 which is the 512MB droplet. 48 49 * `snapshot_name` (string) - The name of the resulting snapshot that will 50 appear in your account. This must be unique. 51 To help make this unique, use a function like `timestamp` (see 52 [configuration templates](/docs/templates/configuration-templates.html) for more info) 53 54 * `ssh_port` (int) - The port that SSH will be available on. Defaults to port 55 22. 56 57 * `ssh_timeout` (string) - The time to wait for SSH to become available 58 before timing out. The format of this value is a duration such as "5s" 59 or "5m". The default SSH timeout is "1m". 60 61 * `ssh_username` (string) - The username to use in order to communicate 62 over SSH to the running droplet. Default is "root". 63 64 * `state_timeout` (string) - The time to wait, as a duration string, 65 for a droplet to enter a desired state (such as "active") before 66 timing out. The default state timeout is "6m". 67 68 ## Basic Example 69 70 Here is a basic example. It is completely valid as soon as you enter your 71 own access tokens: 72 73 <pre class="prettyprint"> 74 { 75 "type": "digitalocean", 76 "client_id": "YOUR CLIENT ID", 77 "api_key": "YOUR API KEY" 78 } 79 </pre> 80 81 ## Finding Image, Region, and Size IDs 82 83 Unfortunately, finding a list of available values for `image_id`, `region_id`, 84 and `size_id` is not easy at the moment. Basically, it has to be done through 85 the [DigitalOcean API](https://www.digitalocean.com/api_access) using the 86 `/images`, `/regions`, and `/sizes` endpoints. You can use `curl` for this 87 or request it in your browser. 88 89 If you're comfortable installing RubyGems, [Tugboat](https://github.com/pearkes/tugboat) 90 is a fantastic DigitalOcean command-line client that has commands to 91 find the available images, regions, and sizes. For example, to see all the 92 global images, you can run `tugboat images --global`.