cold-restaurant-98613
02/20/2024, 8:27 AMresource "aws_lb_target_group" "target_group" {
name = "${var.env}-${var.service_name}-tg"
target_type = "ip"
protocol = "HTTP"
port = 80
vpc_id = var.vpc_id # Referencing the default VPC
health_check {
protocol = "HTTP"
port = "80"
path = "/"
matcher = "200"
healthy_threshold = 3
unhealthy_threshold = 3
timeout = 5
interval = 10
}
tags = {
Name = "${var.service_name}-tg"
Environment = var.env
Project = var.service_name
}
}
resource "aws_lb_listener" "http_listener" {
load_balancer_arn = aws_alb.alb.arn # Referencing our load balancer
port = "80"
protocol = "HTTP"
default_action {
type = "redirect"
redirect {
port = "443"
protocol = "HTTPS"
status_code = "HTTP_301"
}
}
}
resource "aws_lb_listener" "https_listener" {
load_balancer_arn = aws_alb.alb.arn # Referencing our load balancer
port = "443"
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-2016-08"
certificate_arn = var.certificate_arn
default_action {
type = "forward"
target_group_arn = aws_lb_target_group.target_group.arn # Referencing our target group
}
}
P.S. I use typescriptadorable-house-61348
02/20/2024, 2:05 PMcold-restaurant-98613
02/20/2024, 2:09 PMgreat-sunset-355
02/21/2024, 3:08 PMawsx
is only a collection of opinionated solutions built on top of classic aws
which is almost 1to1 terraform aws provider. You should be able to map terraform resources to pulumi. CamelCase vs snake_case. "Data" resources in TF = functions in pulumi