From a4170247b3b0955b1f4a1fa3ed4c9ecf49ed7818 Mon Sep 17 00:00:00 2001 From: Damien A Date: Mon, 5 Feb 2024 17:25:18 +0100 Subject: [PATCH] ec2.tf : use variable for ingress rules --- terraform/ec2.tf | 4 ++-- terraform/variables.tf | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/terraform/ec2.tf b/terraform/ec2.tf index a5af368..8da8128 100755 --- a/terraform/ec2.tf +++ b/terraform/ec2.tf @@ -18,13 +18,13 @@ resource "aws_security_group" "netlab_sg" { from_port = 22 to_port = 22 protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] + cidr_blocks = [var.AWS_LOCAL_IP] } ingress { from_port = 50080 to_port = 50080 protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] + cidr_blocks = [var.AWS_LOCAL_IP] } } diff --git a/terraform/variables.tf b/terraform/variables.tf index 865b22f..a13af31 100755 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -8,6 +8,11 @@ variable "AWS_R53_ENABLED" { default = false } +variable "AWS_LOCAL_IP" { + type = string + default = "0.0.0.0/0" +} + variable "GITHUB_REPO_URL" { type = string default = ""