diff --git a/terraform/env/dev.tfvars b/terraform/env/dev.tfvars index bc34f8f..a7f9061 100644 --- a/terraform/env/dev.tfvars +++ b/terraform/env/dev.tfvars @@ -3,4 +3,4 @@ aws_profile = "dev" vpc_id = "vpc-0b1ae7a4fa0ec7d9d" SUB_NET_01 = "subnet-05d245e39491bb3d2" SUB_NET_02 = "subnet-06761316782230c98" -base_url_internal = "internal-sbf-exchangerate-dev-lb-1838583828.us-east-1.elb.amazonaws.com" +SG_ID = "sg-026d83888df8aa77d" \ No newline at end of file diff --git a/terraform/env/hml.tfvars b/terraform/env/hml.tfvars index 3aa6b0a..7d78a38 100644 --- a/terraform/env/hml.tfvars +++ b/terraform/env/hml.tfvars @@ -3,4 +3,4 @@ aws_profile = "hml" vpc_id = "vpc-0b1ae7a4fa0ec7d9d" SUB_NET_01 = "subnet-05d245e39491bb3d2" SUB_NET_02 = "subnet-06761316782230c98" -base_url_internal = "internal-sbf-exchangerate-dev-lb-1838583828.us-east-1.elb.amazonaws.com" +SG_ID = "sg-026d83888df8aa77d" \ No newline at end of file diff --git a/terraform/env/prd.tfvars b/terraform/env/prd.tfvars index e4e3853..5607fe8 100644 --- a/terraform/env/prd.tfvars +++ b/terraform/env/prd.tfvars @@ -1,6 +1,6 @@ ENV = "prd" aws_profile = "prd" vpc_id = "vpc-0b1ae7a4fa0ec7d9d" -SUB_NET_01 = "subnet-05d245e39491bb3d2" -SUB_NET_02 = "subnet-06761316782230c98" -base_url_internal = "internal-sbf-exchangerate-dev-lb-1838583828.us-east-1.elb.amazonaws.com" +SUB_NET_01 = "subnet-06761316782230c98" +SUB_NET_02 = "subnet-052df03e273a7e04c" +SG_ID = "sg-026d83888df8aa77d" \ No newline at end of file diff --git a/terraform/load-balance.tf b/terraform/load-balance.tf index e848b90..0367866 100644 --- a/terraform/load-balance.tf +++ b/terraform/load-balance.tf @@ -2,7 +2,7 @@ resource "aws_lb" "lb-sbf-exchangerate" { name = "sbf-exchangerate-${var.aws_profile}-lb" internal = true load_balancer_type = "application" - security_groups = [aws_security_group.lb.id] + security_groups = [var.SG_ID] subnets = [var.SUB_NET_01, var.SUB_NET_02] ip_address_type = "ipv4" diff --git a/terraform/security-group.tf b/terraform/security-group.tf deleted file mode 100644 index 7c67015..0000000 --- a/terraform/security-group.tf +++ /dev/null @@ -1,24 +0,0 @@ -resource "aws_security_group" "lb" { - name = "sbf-exchangerate-${var.ENV}-alb-sg" - description = "Allow TLS inbound traffic" - vpc_id = var.vpc_id - - ingress { - description = "HTTP from ALL" - from_port = 80 - to_port = 80 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - tags = { - Name = "allow_tls" - } -} \ No newline at end of file diff --git a/terraform/variables.tf b/terraform/variables.tf index 849d01e..08e851b 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -20,13 +20,14 @@ variable "SUB_NET_02" { default = null } -variable "base_url_internal" { - type = string - description = "base url internal for exchange rate microsservice" -} - variable "aws_profile" { type = string description = "AWS Profile" default = null } + +variable "SG_ID" { + type = string + description = "security group id" + default = null +} \ No newline at end of file