Make Private Networking optional

This commit is contained in:
2021-05-01 17:54:31 -05:00
parent 64d119f011
commit 334f8165d3
4 changed files with 9 additions and 4 deletions

View File

@@ -4,10 +4,10 @@ resource "digitalocean_droplet" "this" {
ipv6 = "true"
monitoring = "true"
name = "${var.host_name}.${var.domain_name}"
private_networking = "true"
private_networking = var.use_vpc > 0 ? "true" : "false"
region = var.region
ssh_keys = var.ssh_keys
size = var.size
tags = var.tags
vpc_uuid = data.digitalocean_vpc.this.id
vpc_uuid = var.use_vpc > 0 ? data.digitalocean_vpc.this[0].id : ""
}