Skip to content

Commit f356bbd

Browse files
committed
examples: update for terraform 0.12.0
1 parent 48cd5bc commit f356bbd

File tree

18 files changed

+82
-47
lines changed

18 files changed

+82
-47
lines changed

examples/application/example.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ data "vultr_plan" "starter" {
4545
resource "vultr_instance" "openvpn" {
4646
name = "openvpn"
4747
hostname = "openvpn"
48-
region_id = "${data.vultr_region.silicon_valley.id}"
49-
plan_id = "${data.vultr_plan.starter.id}"
50-
os_id = "${data.vultr_os.application.id}"
51-
application_id = "${data.vultr_application.openvpn.id}"
48+
region_id = data.vultr_region.silicon_valley.id
49+
plan_id = data.vultr_plan.starter.id
50+
os_id = data.vultr_os.application.id
51+
application_id = data.vultr_application.openvpn.id
5252
}

examples/application/versions.tf

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

examples/bare_metal/example.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ data "vultr_bare_metal_plan" "eightcpus" {
3232
resource "vultr_bare_metal" "example" {
3333
name = "example"
3434
hostname = "example"
35-
region_id = "${data.vultr_region.silicon_valley.id}"
36-
plan_id = "${data.vultr_bare_metal_plan.eightcpus.id}"
37-
os_id = "${data.vultr_os.container_linux.id}"
35+
region_id = data.vultr_region.silicon_valley.id
36+
plan_id = data.vultr_bare_metal_plan.eightcpus.id
37+
os_id = data.vultr_os.container_linux.id
3838
}

examples/bare_metal/versions.tf

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

examples/basic/example.tf

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ data "vultr_plan" "starter" {
3636
// Create a Vultr virtual machine.
3737
resource "vultr_instance" "example" {
3838
name = "example"
39-
region_id = "${data.vultr_region.silicon_valley.id}"
40-
plan_id = "${data.vultr_plan.starter.id}"
41-
os_id = "${data.vultr_os.container_linux.id}"
42-
ssh_key_ids = ["${vultr_ssh_key.squat.id}"]
39+
region_id = data.vultr_region.silicon_valley.id
40+
plan_id = data.vultr_plan.starter.id
41+
os_id = data.vultr_os.container_linux.id
42+
ssh_key_ids = [vultr_ssh_key.squat.id]
4343
hostname = "example"
4444
tag = "container-linux"
45-
firewall_group_id = "${vultr_firewall_group.example.id}"
45+
firewall_group_id = vultr_firewall_group.example.id
4646

4747
connection {
48-
host = "${vultr_instance.example.ipv4_address}"
48+
host = vultr_instance.example.ipv4_address
4949
}
5050

5151
provisioner "remote-exec" {
@@ -60,7 +60,7 @@ resource "vultr_firewall_group" "example" {
6060

6161
// Add a firewall rule to the group allowing SSH access.
6262
resource "vultr_firewall_rule" "ssh" {
63-
firewall_group_id = "${vultr_firewall_group.example.id}"
63+
firewall_group_id = vultr_firewall_group.example.id
6464
cidr_block = "0.0.0.0/0"
6565
protocol = "tcp"
6666
from_port = 22
@@ -70,7 +70,7 @@ resource "vultr_firewall_rule" "ssh" {
7070

7171
// Add a firewall rule to the group allowing ICMP.
7272
resource "vultr_firewall_rule" "icmp" {
73-
firewall_group_id = "${vultr_firewall_group.example.id}"
73+
firewall_group_id = vultr_firewall_group.example.id
7474
cidr_block = "0.0.0.0/0"
7575
protocol = "icmp"
7676
notes = "icmp"
@@ -79,17 +79,20 @@ resource "vultr_firewall_rule" "icmp" {
7979
// Create a new SSH key.
8080
resource "vultr_ssh_key" "squat" {
8181
name = "squat"
82-
public_key = "${file("~/lserven.ssh")}"
82+
public_key = file("~/lserven.ssh")
8383
}
8484

8585
// Add two extra IPv4 addresses to the virtual machine.
8686
resource "vultr_ipv4" "example" {
87-
instance_id = "${vultr_instance.example.id}"
87+
instance_id = vultr_instance.example.id
8888
reboot = false
8989
count = 2
9090
}
9191

9292
// Output all of the virtual machine's IPv4 addresses to STDOUT when the infrastructure is ready.
93-
output ip_addresses {
94-
value = "${concat(vultr_ipv4.example.*.ipv4_address, list(vultr_instance.example.ipv4_address))}"
93+
output "ip_addresses" {
94+
value = concat(
95+
vultr_ipv4.example.*.ipv4_address,
96+
[vultr_instance.example.ipv4_address],
97+
)
9598
}

examples/basic/versions.tf

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

examples/block_storage/example.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ data "vultr_region" "has_block_storage" {
1515
// Create block storage.
1616
resource "vultr_block_storage" "example" {
1717
name = "example"
18-
region_id = "${data.vultr_region.has_block_storage.id}"
18+
region_id = data.vultr_region.has_block_storage.id
1919
size = 50
2020
}

examples/block_storage/versions.tf

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

examples/dns/example.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ resource "vultr_dns_domain" "example" {
1212

1313
// Create a new DNS record.
1414
resource "vultr_dns_record" "example_web" {
15-
domain = "${vultr_dns_domain.example.id}"
15+
domain = vultr_dns_domain.example.id
1616
name = "www"
1717
type = "A"
18-
data = "${vultr_dns_domain.example.ip}"
18+
data = vultr_dns_domain.example.ip
1919
ttl = 300
2020
}

examples/dns/versions.tf

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

0 commit comments

Comments
 (0)