Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Commit c37fffe

Browse files
skylertomarkpeek
authored andcommitted
Updates for terraform 0.12.0 (#17)
* Add support for terraform 0.12.0 * Replaces TypeMap in TypeMap with TypeString TypeMaps with Elem TypeMap is no longer supported by terraform 12. * Updates to readme, docs, and examples to support terraform 12 Signed-off-by: skylerto <skylerclayne@gmail.com>
1 parent 33a6e13 commit c37fffe

File tree

990 files changed

+150485
-20893
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

990 files changed

+150485
-20893
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ resource "vra7_deployment" "example_machine1" {
9797
reasons = "I have some"
9898
description = "deployment via terraform"
9999
resource_configuration = {
100-
Linux.cpu = "1"
101-
Windows2008R2SP1.cpu = "2"
102-
Windows2012.cpu = "4"
103-
Windows2016.cpu = "2"
100+
"Linux.cpu" = "1"
101+
"Windows2008R2SP1.cpu" = "2"
102+
"Windows2012.cpu" = "4"
103+
"Windows2016.cpu" = "2"
104104
}
105105
deployment_configuration = {
106-
_leaseDays = "5"
106+
"_leaseDays" = "5"
107107
}
108108
count = 3
109109
}
@@ -114,10 +114,10 @@ resource "vra7_deployment" "example_machine1" {
114114
resource "vra7_deployment" "example_machine2" {
115115
catalog_item_id = "e5dd4fba7f96239286be45ed"
116116
resource_configuration = {
117-
Linux.cpu = "1"
118-
Windows2008.cpu = "2"
119-
Windows2012.cpu = "4"
120-
Windows2016.cpu = "2"
117+
"Linux.cpu" = "1"
118+
"Windows2008.cpu" = "2"
119+
"Windows2012.cpu" = "4"
120+
"Windows2016.cpu" = "2"
121121
}
122122
count = 4
123123
}

example/depends_on/main.tf

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
provider "vra7" {
2-
username = "${var.username}"
3-
password = "${var.password}"
4-
tenant = "${var.tenant}"
5-
host = "${var.host}"
1+
provider "vra7" {
2+
username = var.username
3+
password = var.password
4+
tenant = var.tenant
5+
host = var.host
66
}
77

88
resource "vra7_deployment" "machine1" {
9-
count = 1
9+
count = 1
1010
catalog_item_name = "CentOS 7.0 x64"
1111
}
1212

1313
resource "vra7_deployment" "machine2" {
14-
count = 1
14+
count = 1
1515
catalog_item_name = "CentOS 7.0 x64"
16-
depends_on = ["vra7_deployment.machine1"]
16+
depends_on = [vra7_deployment.machine1]
1717
}
18+

example/depends_on/variables.tf

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
variable username {}
2-
variable password {}
3-
variable tenant {}
4-
variable host {}
1+
variable "username" {
2+
}
3+
4+
variable "password" {
5+
}
6+
7+
variable "tenant" {
8+
}
9+
10+
variable "host" {
11+
}
12+

example/depends_on/versions.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
terraform {
3+
required_version = ">= 0.12"
4+
}

example/multi-machine/main.tf

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
provider "vra7" {
2-
username = "${var.username}"
3-
password = "${var.password}"
4-
tenant = "${var.tenant}"
5-
host = "${var.host}"
1+
provider "vra7" {
2+
username = var.username
3+
password = var.password
4+
tenant = var.tenant
5+
host = var.host
66
}
77

88
# Catalog "multi_machine_catalog" contains Linux, Windows and http (apache) designs.
99
resource "vra7_deployment" "resource_1" {
10-
count = 1
10+
count = 1
1111
catalog_item_name = "multi_machine_catalog"
1212
resource_configuration = {
13-
Windows.cpu = "2" //Windows Machine CPU
14-
Linux.cpu = "2" //Linux Machine CPU
15-
http.hostname = "xyz.com" //HTTP (apache) hostname
16-
http.network_mode = "bridge" //HTTP (apache) network mode
13+
"Windows.cpu" = "2" //Windows Machine CPU
14+
"Linux.cpu" = "2" //Linux Machine CPU
15+
"http.hostname" = "xyz.com" //HTTP (apache) hostname
16+
"http.network_mode" = "bridge" //HTTP (apache) network mode
1717
}
18-
}
18+
}
19+

example/multi-machine/variables.tf

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
variable username {}
2-
variable password {}
3-
variable tenant {}
4-
variable host {}
1+
variable "username" {
2+
}
3+
4+
variable "password" {
5+
}
6+
7+
variable "tenant" {
8+
}
9+
10+
variable "host" {
11+
}
12+

example/multi-machine/versions.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
terraform {
3+
required_version = ">= 0.12"
4+
}

example/remote-execute/main.tf

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,39 @@
11
provider "vra7" {
2-
username = "${var.username}"
3-
password = "${var.password}"
4-
tenant = "${var.tenant}"
5-
host = "${var.host}"
2+
username = var.username
3+
password = var.password
4+
tenant = var.tenant
5+
host = var.host
66
}
77

88
resource "vra7_deployment" "vm" {
9-
catalog_item_name = "${var.catalog_item_name}"
10-
reasons = "${var.description}"
11-
description = "${var.description}"
9+
catalog_item_name = var.catalog_item_name
10+
reasons = var.description
11+
description = var.description
1212

13-
count = "${var.count}"
13+
count = var.count
1414

1515
deployment_configuration = {
16-
VirtualMachine.Disk1.Size = "${var.extra_disk}"
16+
VirtualMachine.Disk1.Size = var.extra_disk
1717
}
1818

19-
resource_configuration {
20-
Machine.description = "${var.description}"
21-
Machine.cpu = "${var.cpu}"
22-
Machine.memory = "${var.ram}"
23-
24-
Machine.ip_address = ""
19+
resource_configuration = {
20+
"Machine.description" = var.description
21+
"Machine.cpu" = var.cpu
22+
"Machine.memory" = var.ram
23+
"Machine.ip_address" = ""
2524
}
2625

27-
wait_timeout = "${var.wait_timeout}"
26+
wait_timeout = var.wait_timeout
2827

28+
// Connection settings
2929
// Connection settings
3030
connection {
31-
host = "${self.resource_configuration.Machine.ip_address}"
32-
user = "${var.ssh_user}"
33-
password = "${var.ssh_password}"
31+
host = self.resource_configuration.Machine.ip_address
32+
user = var.ssh_user
33+
password = var.ssh_password
3434
}
3535

36+
// Extend volume to second disk
3637
// Extend volume to second disk
3738
provisioner "remote-exec" {
3839
inline = [
@@ -43,3 +44,4 @@ resource "vra7_deployment" "vm" {
4344
]
4445
}
4546
}
47+
Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
variable username {}
2-
variable password {}
3-
variable tenant {}
4-
variable host {}
1+
variable "username" {
2+
}
3+
4+
variable "password" {
5+
}
6+
7+
variable "tenant" {
8+
}
9+
10+
variable "host" {
11+
}
12+
13+
variable "catalog_item_name" {
14+
}
515

6-
variable "catalog_item_name" {}
7-
variable "count" {}
16+
variable "count" {
17+
}
818

919
variable "cpu" {
1020
default = 1
@@ -14,13 +24,19 @@ variable "ram" {
1424
default = 512
1525
}
1626

17-
variable "extra_disk" {}
27+
variable "extra_disk" {
28+
}
29+
30+
variable "description" {
31+
}
1832

19-
variable "description" {}
33+
variable "ssh_user" {
34+
}
2035

21-
variable "ssh_user" {}
22-
variable "ssh_password" {}
36+
variable "ssh_password" {
37+
}
2338

2439
variable "wait_timeout" {
2540
default = 30
2641
}
42+

example/remote-execute/versions.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
terraform {
3+
required_version = ">= 0.12"
4+
}

0 commit comments

Comments
 (0)