Skip to content

Commit

Permalink
moved out embedded security group
Browse files Browse the repository at this point in the history
  • Loading branch information
cweibel committed Jun 17, 2022
1 parent f8195d6 commit 23033a3
Showing 1 changed file with 1 addition and 72 deletions.
73 changes: 1 addition & 72 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,6 @@ variable internal_lb { default = true } # Determine whether the load b
variable enable_route_53 { default = 1 } # Disable if using CloudFlare or other DNS


resource "aws_security_group" "cf_tcp_lb_security_group" {
name = "cf-tcp-lb-security-group"
description = "CF TCP"
vpc_id = var.vpc_id

ingress {
cidr_blocks = var.private_cidrs
protocol = "tcp"
from_port = 40000
to_port = 40100
}

egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = var.private_cidrs
}

tags = merge({Name = "cf-tcp-lb-security-group"}, var.resource_tags)

lifecycle {
ignore_changes = [name]
}
}



resource "aws_security_group" "cf_tcp_lb_internal_security_group" {
name = "cf-tcp-lb-internal-security-group"
description = "CF TCP Internal"
vpc_id = var.vpc_id

ingress {
security_groups = ["${aws_security_group.cf_tcp_lb_security_group.id}"]
protocol = "tcp"
from_port = 40000
to_port = 40100
}

ingress {
security_groups = ["${aws_security_group.cf_tcp_lb_security_group.id}"]
protocol = "tcp"
from_port = 80
to_port = 80
}

egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = var.private_cidrs
}

tags = merge({Name = "cf-tcp-lb-internal-security-group"}, var.resource_tags)


lifecycle {
ignore_changes = [name]
}
}


resource "aws_elb" "cf_tcp_lb" {
Expand All @@ -87,10 +26,7 @@ resource "aws_elb" "cf_tcp_lb" {
}


security_groups = [
aws_security_group.cf_tcp_lb_security_group.id,
var.security_groups
]
security_groups = var.security_groups
subnets = var.subnet_ids


Expand Down Expand Up @@ -724,10 +660,3 @@ output "dns_name" {value = aws_elb.cf_tcp_lb.dns_name}
output "lb_name" {value = aws_elb.cf_tcp_lb.name }



#output "cf_tcp_lb_internal_security_group" {
# value = "${aws_security_group.cf_tcp_lb_internal_security_group.id}"
#}
#output "cf_tcp_lb_security_group" {
# value = "${aws_security_group.cf_tcp_lb_security_group.id}"
#}

0 comments on commit 23033a3

Please sign in to comment.