File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # 0.5.8 (Apr 03, 2025)
2+ * Added support for optional IP whitelist (` var.ip_whitelist ` ).
3+
14# 0.5.7 (Mar 31, 2025)
25* Use SSL certificate from connected subdomain if it created one.
36
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ resource "aws_security_group_rule" "lb-https-from-world" {
3636 count = var. enable_https ? 1 : 0
3737
3838 security_group_id = aws_security_group. lb . id
39- cidr_blocks = [ " 0.0.0.0/0 " ]
39+ cidr_blocks = local . allow_ips
4040 type = " ingress"
4141 protocol = " tcp"
4242 from_port = 443
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ resource "aws_security_group" "lb" {
77// This rule is always enabled; when we are listening on https, we still want to force http to https through redirect
88resource "aws_security_group_rule" "lb-http-from-world" {
99 security_group_id = aws_security_group. lb . id
10- cidr_blocks = [ " 0.0.0.0/0 " ]
10+ cidr_blocks = local . allow_ips
1111 type = " ingress"
1212 protocol = " tcp"
1313 from_port = 80
Original file line number Diff line number Diff line change 11data "ns_connection" "subdomain" {
22 name = " subdomain"
3- type = " subdomain/aws"
43 contract = " subdomain/aws/route53"
54 optional = ! var. enable_https
65}
Original file line number Diff line number Diff line change @@ -148,3 +148,16 @@ Time in seconds that the connection is allowed to be idle.
148148Default: 60.
149149EOF
150150}
151+
152+ variable "ip_whitelist" {
153+ type = list (string )
154+ default = []
155+ description = << EOF
156+ Specify a list of source IP addresses that can reach this load balancer.
157+ If null or empty, this load balancer allows any IP address to access it.
158+ EOF
159+ }
160+
161+ locals {
162+ allow_ips = (var. ip_whitelist == null || length (var. ip_whitelist ) == 0 ) ? [" 0.0.0.0/0" ] : var. ip_whitelist
163+ }
You can’t perform that action at this time.
0 commit comments