Skip to content
Snippets Groups Projects
Verified Commit 2f005581 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

terrafrom: Make subnets optional for instances

parent 3c471d9d
No related branches found
No related tags found
No related merge requests found
resource "hcloud_server_network" "server_network" {
server_id = element(hcloud_server.server.*.id, count.index)
subnet_id = var.subnet
count = length(hcloud_server.server.*.id)
count = var.subnet != null ? length(hcloud_server.server.*.id) : 0
}
......@@ -92,4 +92,5 @@ variable "volume_size" {
variable "subnet" {
type = string
description = "Id of the additional internal network"
default = null
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment