Skip to content

Commit 9e06935

Browse files
committed
Make domains an optional input
1 parent 67f95d0 commit 9e06935

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ resource "upcloud_loadbalancer_frontend" "main" {
4040
}
4141

4242
resource "upcloud_loadbalancer_dynamic_certificate_bundle" "main" {
43+
count = length(var.domains) > 0 ? 1 : 0
4344
name = "main"
4445
hostnames = var.domains
4546
key_type = "rsa"
4647
}
4748

4849
resource "upcloud_loadbalancer_frontend_tls_config" "main" {
50+
count = length(var.domains) > 0 ? 1 : 0
4951
frontend = upcloud_loadbalancer_frontend.main.id
5052
name = "main"
51-
certificate_bundle = upcloud_loadbalancer_dynamic_certificate_bundle.main.id
53+
certificate_bundle = upcloud_loadbalancer_dynamic_certificate_bundle.main[count.index].id
5254
}

variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ variable "max_server_sessions" {
4242
}
4343

4444
variable "domains" {
45-
description = "List of domains that will be used with this load balancer. All of the domains in this list should have a CNAME record set pointing to load balancer DNS name (see `dns_name` output)"
45+
description = "List of domains that will be used with this load balancer. All of the domains in this list should have a CNAME record set pointing to load balancer DNS name (see `dns_name` output). If left empty, no TLS configuration will be created for the load balancer frontend."
4646
type = list(string)
47+
default = []
4748
}

0 commit comments

Comments
 (0)