builder/hyperone: Add examples for HCL syntax

This commit is contained in:
Adam Dobrawy 2020-05-19 01:20:15 +02:00
parent 170520dcca
commit a3cba02c86
2 changed files with 69 additions and 0 deletions

View File

@ -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"
]
}
}

View File

@ -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"
]
}
}
```