From a3cba02c866008ab51775071b5726d90d5495e5a Mon Sep 17 00:00:00 2001 From: Adam Dobrawy Date: Tue, 19 May 2020 01:20:15 +0200 Subject: [PATCH] builder/hyperone: Add examples for HCL syntax --- examples/hyperone/new-syntax.pkr.hcl | 32 ++++++++++++++++++++ website/pages/docs/builders/hyperone.mdx | 37 ++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 examples/hyperone/new-syntax.pkr.hcl diff --git a/examples/hyperone/new-syntax.pkr.hcl b/examples/hyperone/new-syntax.pkr.hcl new file mode 100644 index 000000000..c2e4da77d --- /dev/null +++ b/examples/hyperone/new-syntax.pkr.hcl @@ -0,0 +1,32 @@ +variable "token" { + type = string +} + +variable "project" { + type = string +} + +source "hyperone" "new-syntax" { + token = var.token + project = var.project + source_image = "debian" + disk_size = 10 + vm_type = "a1.nano" + image_name = "packerbats-hcl-{{timestamp}}" + image_tags = { + key="value" + } +} + +build { + sources = [ + "source.hyperone.new-syntax" + ] + + provisioner "shell" { + inline = [ + "apt-get update", + "apt-get upgrade -y" + ] + } +} \ No newline at end of file diff --git a/website/pages/docs/builders/hyperone.mdx b/website/pages/docs/builders/hyperone.mdx index 2ac12dd9e..9d5ed47c2 100644 --- a/website/pages/docs/builders/hyperone.mdx +++ b/website/pages/docs/builders/hyperone.mdx @@ -243,3 +243,40 @@ token. ] } ``` + +## HCL Example + +```hcl +variable "token" { + type = string +} + +variable "project" { + type = string +} + +source "hyperone" "new-syntax" { + token = var.token + project = var.project + source_image = "debian" + disk_size = 10 + vm_type = "a1.nano" + image_name = "packerbats-hcl-{{timestamp}}" + image_tags = { + key="value" + } +} + +build { + sources = [ + "source.hyperone.new-syntax" + ] + + provisioner "shell" { + inline = [ + "apt-get update", + "apt-get upgrade -y" + ] + } +} +``` \ No newline at end of file