-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: register service to multiple target groups (#70)
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// In case of extra target groups (extra_target_groups) | ||
|
||
resource "aws_lb_target_group" "extra" { | ||
name = "${var.name_prefix}-3000" | ||
port = 3000 // extra port the Fargate service expose | ||
protocol = "HTTP" | ||
target_type = "ip" | ||
vpc_id = data.aws_vpc.main.id | ||
tags = { | ||
environment = "dev" | ||
terraform = "True" | ||
} | ||
} | ||
|
||
|
||
resource "aws_lb_listener" "extra_listener" { | ||
load_balancer_arn = module.fargate_alb.arn | ||
port = 9000 // The port alb listen to and, bind to the service port (3000) | ||
protocol = "HTTP" | ||
|
||
default_action { | ||
target_group_arn = aws_lb_target_group.extra.arn | ||
type = "forward" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters