github.com/raghuse92/packer@v1.3.2/website/source/docs/builders/digitalocean.html.md (about) 1 --- 2 description: | 3 The digitalocean Packer builder is able to create new images for use with 4 DigitalOcean. The builder takes a source image, runs any provisioning 5 necessary on the image after launching it, then snapshots it into a reusable 6 image. This reusable image can then be used as the foundation of new servers 7 that are launched within DigitalOcean. 8 layout: docs 9 page_title: 'DigitalOcean - Builders' 10 sidebar_current: 'docs-builders-digitalocean' 11 --- 12 13 # DigitalOcean Builder 14 15 Type: `digitalocean` 16 17 The `digitalocean` Packer builder is able to create new images for use with 18 [DigitalOcean](https://www.digitalocean.com). The builder takes a source image, 19 runs any provisioning necessary on the image after launching it, then snapshots 20 it into a reusable image. This reusable image can then be used as the foundation 21 of new servers that are launched within DigitalOcean. 22 23 The builder does *not* manage images. Once it creates an image, it is up to you 24 to use it or delete it. 25 26 ## Configuration Reference 27 28 There are many configuration options available for the builder. They are 29 segmented below into two categories: required and optional parameters. Within 30 each category, the available configuration keys are alphabetized. 31 32 In addition to the options listed here, a 33 [communicator](/docs/templates/communicator.html) can be configured for this 34 builder. 35 36 ### Required: 37 38 - `api_token` (string) - The client TOKEN to use to access your account. It 39 can also be specified via environment variable `DIGITALOCEAN_API_TOKEN`, 40 if set. 41 42 - `image` (string) - The name (or slug) of the base image to use. This is the 43 image that will be used to launch a new droplet and provision it. See 44 <https://developers.digitalocean.com/documentation/v2/#list-all-images> for 45 details on how to get a list of the accepted image names/slugs. 46 47 - `region` (string) - The name (or slug) of the region to launch the 48 droplet in. Consequently, this is the region where the snapshot will 49 be available. See 50 <https://developers.digitalocean.com/documentation/v2/#list-all-regions> for 51 the accepted region names/slugs. 52 53 - `size` (string) - The name (or slug) of the droplet size to use. See 54 <https://developers.digitalocean.com/documentation/v2/#list-all-sizes> for 55 the accepted size names/slugs. 56 57 ### Optional: 58 59 - `api_url` (string) - Non standard api endpoint URL. Set this if you are 60 using a DigitalOcean API compatible service. It can also be specified via 61 environment variable `DIGITALOCEAN_API_URL`. 62 63 - `droplet_name` (string) - The name assigned to the droplet. DigitalOcean 64 sets the hostname of the machine to this value. 65 66 - `private_networking` (boolean) - Set to `true` to enable private networking 67 for the droplet being created. This defaults to `false`, or not enabled. 68 69 - `monitoring` (boolean) - Set to `true` to enable monitoring 70 for the droplet being created. This defaults to `false`, or not enabled. 71 72 - `ipv6` (boolean) - Set to `true` to enable ipv6 73 for the droplet being created. This defaults to `false`, or not enabled. 74 75 - `snapshot_name` (string) - The name of the resulting snapshot that will 76 appear in your account. Defaults to "packer-{{timestamp}}" (see 77 [configuration templates](/docs/templates/engine.html) for more info). 78 79 - `snapshot_regions` (array of strings) - The regions of the resulting snapshot that will 80 appear in your account. 81 82 - `state_timeout` (string) - The time to wait, as a duration string, for a 83 droplet to enter a desired state (such as "active") before timing out. The 84 default state timeout is "6m". 85 86 - `user_data` (string) - User data to launch with the Droplet. 87 88 - `user_data_file` (string) - Path to a file that will be used for the user 89 data when launching the Droplet. 90 91 - `tags` (list) - Tags to apply to the droplet when it is created 92 93 ## Basic Example 94 95 Here is a basic example. It is completely valid as soon as you enter your own 96 access tokens: 97 98 ``` json 99 { 100 "type": "digitalocean", 101 "api_token": "YOUR API KEY", 102 "image": "ubuntu-16-04-x64", 103 "region": "nyc3", 104 "size": "512mb", 105 "ssh_username": "root" 106 } 107 ```