forked from collabnix/terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c37329
commit 77a9d38
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
beginners/aws/modules/application_load_balancer/loadbalancer.tf
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,27 @@ | ||
resource "aws_lb" "my-lb" { | ||
name = "lb-tf" | ||
internal = false | ||
load_balancer_type = "application" | ||
security_groups = [aws_security_group.allow_http.id] | ||
# Enter you subnet ids under vpc below | ||
subnets = ["subnet-id1","subnet-id2","subnet-id3","subnet-id4"] | ||
|
||
enable_deletion_protection = false | ||
|
||
|
||
|
||
tags = { | ||
name = "my-first-load-balancer" | ||
} | ||
} | ||
|
||
resource "aws_lb_listener" "front_end" { | ||
load_balancer_arn = aws_lb.my-lb.arn | ||
port = "80" | ||
protocol = "HTTP" | ||
|
||
default_action { | ||
type = "forward" | ||
target_group_arn = aws_lb_target_group.target-lb.arn | ||
} | ||
} |