-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathimport.pkr.hcl
More file actions
41 lines (36 loc) · 946 Bytes
/
import.pkr.hcl
File metadata and controls
41 lines (36 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
variable "username" {
type = string
description = "UpCloud API username"
default = env("UPCLOUD_USERNAME")
}
variable "password" {
type = string
description = "UpCloud API password"
default = env("UPCLOUD_PASSWORD")
sensitive = true
}
variable "image_path" {
type = string
description = "Image path"
default = env("UPCLOUD_IMAGE_PATH")
}
source "file" "import-example" {
source = var.image_path
target = "tmp/${basename(var.image_path)}"
}
build {
sources = ["file.import-example"]
post-processors {
post-processor "compress" {
output = "tmp/${basename(var.image_path)}.gz"
}
post-processor "upcloud-import" {
template_name = "import-demo"
replace_existing = true
username = "${var.username}"
password = "${var.password}"
zones = ["pl-waw1", "fi-hel2"]
storage_tier = "maxiops"
}
}
}