Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change internal port #21

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions elb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ resource "aws_security_group" "elb" {

resource "aws_security_group_rule" "elb_egress" {
description = "Allow traffic from the ELB to the instances"
from_port = 80
from_port = var.elb_to_ec2_port
protocol = "tcp"
security_group_id = aws_security_group.elb.id
source_security_group_id = aws_security_group.this.id
to_port = 80
to_port = var.elb_to_ec2_port
type = "egress"
}

Expand Down Expand Up @@ -97,7 +97,7 @@ resource "aws_lb_target_group" "this" {
name_prefix = substr(var.name, 0, 6)
# Nexus has a bad time if two instances are running at once, so the deregistration delay needs to be short
deregistration_delay = 10
port = "80"
port = var.elb_to_ec2_port
protocol = "HTTP"
tags = var.tags
vpc_id = var.vpc_id
Expand All @@ -107,7 +107,7 @@ resource "aws_lb_target_group" "this" {
interval = 15
matcher = "200-299,302"
protocol = "HTTP"
port = "80"
port = var.elb_to_ec2_port
}

lifecycle {
Expand Down Expand Up @@ -146,7 +146,7 @@ resource "aws_lb_target_group" "additional_this" {
interval = 15
matcher = "200-299,302"
protocol = "HTTP"
port = "80"
port = var.elb_to_ec2_port
}

lifecycle {
Expand Down
4 changes: 2 additions & 2 deletions groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ resource "aws_security_group_rule" "allow_all" {

resource "aws_security_group_rule" "allow_inbound_http_from_lb" {
description = "Allow traffic from the load balancer"
from_port = 80
from_port = var.elb_to_ec2_port
protocol = "tcp"
security_group_id = aws_security_group.this.id
source_security_group_id = aws_security_group.elb.id
to_port = 80
to_port = var.elb_to_ec2_port
type = "ingress"
}

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ variable "elb_subnets" {
type = list(string)
}

variable "elb_to_ec2_port" {
default = 80
description = "Subnets to associate ELB to"
type = number
}


variable "vpc_id" {
description = "VPC to create associated resources in"
Expand Down