Skip to content

Instantly share code, notes, and snippets.

@100daysofdevops
Created February 27, 2019 21:43
Show Gist options
  • Select an option

  • Save 100daysofdevops/172e2b5dbc6e69c0b225f01471b05efe to your computer and use it in GitHub Desktop.

Select an option

Save 100daysofdevops/172e2b5dbc6e69c0b225f01471b05efe to your computer and use it in GitHub Desktop.
provider "aws" {
region = "us-west-2"
}
resource "aws_lb" "ec2cc8bcb4" {
name = "my-test-lb"
internal = false
security_groups = [
"sg-08dafd1cf6d4ffbf3"
]
subnets = [
"subnet-f3e4988a",
"subnet-278a136c"
]
tags = []
ip_address_type = "ipv4"
load_balancer_type = "application"
}
resource "aws_lb_target_group" "ec259fb72e" {
health_check {
interval = 30
path = "/"
protocol = "HTTP"
timeout = 5
healthy_threshold = 5
unhealthy_threshold = 2
matcher {
HttpCode = "200"
}
}
name = "my-lb-tg"
port = 80
protocol = "HTTP"
target_type = "instance"
vpc_id = "vpc-4a8c6b32"
}
resource "aws_lb_target_group_attachment" "elbv204c5dd3" {
target_group_arn = "arn:aws:elasticloadbalancing:us-west-2:188140964824:targetgroup/my-lb-tg/a76ad1786beb9aac"
target_id = "i-09f503bc5f6bb6077"
port = 80
}
resource "aws_lb_target_group_attachment" "elbv21e146e8" {
target_group_arn = "arn:aws:elasticloadbalancing:us-west-2:188140964824:targetgroup/my-lb-tg/a76ad1786beb9aac"
target_id = "i-09f503bc5f6bb6077"
port = 80
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment