Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #60 from bwalendz/sgr-allow-empty-cidrs
Browse files Browse the repository at this point in the history
[nomad-security-group-rules] allow empty list of allowed inbound CIDRs
  • Loading branch information
brikis98 authored Feb 26, 2020
2 parents 3b553ca + deb2d8b commit 5ecf115
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/nomad-security-group-rules/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ terraform {
}

resource "aws_security_group_rule" "allow_http_inbound" {
count = length(var.allowed_inbound_cidr_blocks) >= 1 ? 1 : 0
type = "ingress"
from_port = var.http_port
to_port = var.http_port
Expand All @@ -21,6 +22,7 @@ resource "aws_security_group_rule" "allow_http_inbound" {
}

resource "aws_security_group_rule" "allow_rpc_inbound" {
count = length(var.allowed_inbound_cidr_blocks) >= 1 ? 1 : 0
type = "ingress"
from_port = var.rpc_port
to_port = var.rpc_port
Expand All @@ -31,6 +33,7 @@ resource "aws_security_group_rule" "allow_rpc_inbound" {
}

resource "aws_security_group_rule" "allow_serf_tcp_inbound" {
count = length(var.allowed_inbound_cidr_blocks) >= 1 ? 1 : 0
type = "ingress"
from_port = var.serf_port
to_port = var.serf_port
Expand All @@ -41,6 +44,7 @@ resource "aws_security_group_rule" "allow_serf_tcp_inbound" {
}

resource "aws_security_group_rule" "allow_serf_udp_inbound" {
count = length(var.allowed_inbound_cidr_blocks) >= 1 ? 1 : 0
type = "ingress"
from_port = var.serf_port
to_port = var.serf_port
Expand Down

0 comments on commit 5ecf115

Please sign in to comment.