Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Add destination_cidr_blocks variable to allow choose sg outbound rule…
Browse files Browse the repository at this point in the history
… cidr blocks
  • Loading branch information
pjuniorlima committed Jan 21, 2022
1 parent 798f037 commit a6f95eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,6 @@ resource "aws_security_group_rule" "egress" {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
cidr_blocks = var.destination_cidr_blocks == [] ? ["0.0.0.0/0"] : var.destination_cidr_blocks
security_group_id = aws_security_group.default.id
}
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ variable "source_cidr_blocks" {
description = "List of source CIDR blocks."
}

variable "destination_cidr_blocks" {
type = list(string)
description = "List of source CIDR blocks."
}

variable "engine_version" {
default = "5.0.6"
type = string
Expand Down

0 comments on commit a6f95eb

Please sign in to comment.