packer-cn/website/content/docs/builders/digitalocean.mdx

70 lines
2.0 KiB
Plaintext
Raw Normal View History

2020-03-18 18:46:47 -04:00
---
description: >
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.
page_title: DigitalOcean - Builders
---
# DigitalOcean Builder
Type: `digitalocean`
Artifact BuilderId: `pearkes.digitalocean`
2020-03-18 18:46:47 -04:00
The `digitalocean` Packer builder is able to create new images for use with
[DigitalOcean](https://www.digitalocean.com). 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.
The builder does _not_ manage images. Once it creates an image, it is up to you
to use it or delete it.
## Configuration Reference
There are many configuration options available for the builder. They are
segmented below into two categories: required and optional parameters. Within
each category, the available configuration keys are alphabetized.
### Required:
@include 'builder/digitalocean/Config-required.mdx'
2020-03-18 18:46:47 -04:00
### Optional:
@include 'builder/digitalocean/Config-not-required.mdx'
2020-03-18 18:46:47 -04:00
## Basic Example
Here is a basic example. It is completely valid as soon as you enter your own
access tokens:
```json
{
"type": "digitalocean",
"api_token": "YOUR API KEY",
"image": "ubuntu-16-04-x64",
"region": "nyc3",
"size": "512mb",
"ssh_username": "root"
}
```
### Communicator Config
In addition to the builder options, a
[communicator](/docs/templates/legacy_json_templates/communicator) can be configured for this builder.
@include 'packer-plugin-sdk/communicator/Config-not-required.mdx'
@include 'packer-plugin-sdk/communicator/SSH-not-required.mdx'
@include 'packer-plugin-sdk/communicator/SSH-Private-Key-File-not-required.mdx'