I have my AWS infrastructure setup in ap-southeast-1 using terraform, however, I want to link my ACM certificate created in us-east1 to my load balancer using aws_alb_listener resource.
resource "aws_alb_listener" "https" {
load_balancer_arn = aws_lb.main.id
port = 443
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-2016-08"
certificate_arn = var.acm_certificate_arn
depends_on = [aws_alb_target_group.main]
default_action {
target_group_arn = aws_alb_target_group.main.arn
type = "forward"
}
}
When I do terraform apply, it raises an error.
Is it possible to attach an ACM certificate to alb from a different region using terraform?
My use case is this cert will also be used in AWS CloudFront as a CDN.
us-east-1
region. ALB requires that the cert be in the same region as the ALB. You'll have to create an ACM certificate in each region. Since they are free, this isn't really an issue. – Mark B