Skip to content

Commit

Permalink
Create loadbalancer.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
jyoti1998-gehlot authored Oct 13, 2021
1 parent 4c37329 commit 77a9d38
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions beginners/aws/modules/application_load_balancer/loadbalancer.tf
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
}
}

0 comments on commit 77a9d38

Please sign in to comment.