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