-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
79 lines (68 loc) · 1.96 KB
/
main.tf
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
provider "hpegl" {
vmaas {
location = var.location
space_name = var.space
}
}
data "hpegl_vmaas_cloud" "cloud" {
name = var.cloud
}
data "hpegl_vmaas_cloud_folder" "compute_folder" {
cloud_id = data.hpegl_vmaas_cloud.cloud.id
name = var.compute_folder
}
data "hpegl_vmaas_group" "vmaas_group" {
name = var.vmaas_group
}
data "hpegl_vmaas_resource_pool" "cl_resource_pool" {
cloud_id = data.hpegl_vmaas_cloud.cloud.id
name = var.cl_resource_pool
}
data "hpegl_vmaas_layout" "vmware" {
name = var.vmware_name
instance_type_code = var.vmware_instance_type_code
}
data "hpegl_vmaas_plan" "vmaas_plan" {
name = var.vmaas_plan
}
data "hpegl_vmaas_template" "vmaas_template" {
name = var.vmaas_template
}
data "hpegl_vmaas_environment" "vmaas_environment" {
name = var.vmaas_environment
}
data "hpegl_vmaas_network" "vmaas_network" {
name = var.vmaas_network
}
#minimal instance creation
resource "hpegl_vmaas_instance" "tf_instance" {
name = var.vmaas_instance_name
cloud_id = data.hpegl_vmaas_cloud.cloud.id
group_id = data.hpegl_vmaas_group.vmaas_group.id
layout_id = data.hpegl_vmaas_layout.vmware.id
plan_id = data.hpegl_vmaas_plan.vmaas_plan.id
instance_type_code = data.hpegl_vmaas_layout.vmware.instance_type_code
network {
id = data.hpegl_vmaas_network.vmaas_network.id
}
volume {
name = "root_vol"
size = 5
datastore_id = "auto"
root = true
}
labels = ["demo_label"]
tags = {
vmType = "VMAAS"
vmUsage = "Test"
}
config {
resource_pool_id = data.hpegl_vmaas_resource_pool.cl_resource_pool.id
no_agent = true
template_id = data.hpegl_vmaas_template.vmaas_template.id
asset_tag = "vm_tag"
folder_code = data.hpegl_vmaas_cloud_folder.compute_folder.code
}
environment_code = data.hpegl_vmaas_environment.vmaas_environment.code
scale = 1
}