From 79bc643c17fb1fccaf688f94758de13192768850 Mon Sep 17 00:00:00 2001 From: Wilken Rivera Date: Tue, 1 Sep 2020 11:08:06 -0400 Subject: [PATCH] post-processor/digitalocean-import: Update documentation (#9865) * Add a note to use the DigitialOcean Builder when working directly on Digital Ocean * Add HCL2 example to the documentation --- .../post-processors/digitalocean-import.mdx | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/website/pages/docs/post-processors/digitalocean-import.mdx b/website/pages/docs/post-processors/digitalocean-import.mdx index cde2a6ceb..6d7db5764 100644 --- a/website/pages/docs/post-processors/digitalocean-import.mdx +++ b/website/pages/docs/post-processors/digitalocean-import.mdx @@ -11,8 +11,10 @@ sidebar_title: DigitalOcean Import Type: `digitalocean-import` -The Packer DigitalOcean Import post-processor takes an image artifact from -various builders and imports it to DigitalOcean. +The Packer DigitalOcean Import post-processor is used to import images created by other Packer builders to DigitalOcean. + +~> Note: Users looking to create custom images, and reusable snapshots, directly on DigitalOcean can use +the [DigitalOcean builder](/docs/builders/digitalocean) without this post-processor. ## How Does it Work? @@ -90,6 +92,9 @@ Optional: Here is a basic example: + + + ```json { "type": "digitalocean-import", @@ -104,3 +109,23 @@ Here is a basic example: "image_tags": ["custom", "packer"] } ``` + + + + +```hcl +post-processor "digitalocean-import" { + api_token = "{{user `token`}}" + spaces_key = "{{user `key`}}" + spaces_secret = "{{user `secret`}}" + spaces_region = "nyc3" + space_name = "import-bucket" + image_name = "ubuntu-18.10-minimal-amd64" + image_description = "Packer import {{timestamp}}" + image_regions = ["nyc3", "nyc2"] + image_tags = ["custom", "packer"] +} +``` + + +