Skip to content

Commit

Permalink
Fix TF timeout when ssh_cidr_blocks is empty
Browse files Browse the repository at this point in the history
Resource aws_security_group_rule.ssh_public_ip would
not be created when empty list (default) was set
for ssh_cidr_blocks. SGR is now conditional on
that var not being empty.
  • Loading branch information
natecollins authored and cjcolvar committed May 1, 2023
1 parent 1191a3e commit 0e72f64
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compose.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ resource "aws_security_group" "public_ip" {
}

resource "aws_security_group_rule" "ssh_public_ip" {
for_each = toset(length(var.ssh_cidr_blocks) > 0 ? ["1"] : [])
type = "ingress"
description = "Allow SSH direct to public IP"
cidr_blocks = var.ssh_cidr_blocks
Expand Down

0 comments on commit 0e72f64

Please sign in to comment.