Cert with load balancer listener
This commit is contained in:
parent
97205a216c
commit
f96f6569cf
11
infra/cert.tf
Normal file
11
infra/cert.tf
Normal file
@ -0,0 +1,11 @@
|
||||
# Here is the TLS cert that we create for the alpha cluster
|
||||
|
||||
resource "aws_acm_certificate" "sample" {
|
||||
domain_name = "sample.project-athens.xyz"
|
||||
validation_method = "DNS"
|
||||
}
|
||||
|
||||
resource "aws_acm_certificate_validation" "sample" {
|
||||
certificate_arn = aws_acm_certificate.sample.arn
|
||||
validation_record_fqdns = [ aws_route53_record.project-athens-record["2"].fqdn ]
|
||||
}
|
@ -25,10 +25,13 @@ resource "aws_lb_target_group" "alpha_cluster" {
|
||||
vpc_id = aws_vpc.athens_vpc.id
|
||||
}
|
||||
|
||||
resource "aws_lb_listener" "http" {
|
||||
resource "aws_lb_listener" "https" {
|
||||
load_balancer_arn = aws_lb.alpha.arn
|
||||
port = 80
|
||||
protocol = "HTTP"
|
||||
port = 443
|
||||
protocol = "HTTPS"
|
||||
ssl_policy = "ELBSecurityPolicy-2016-08"
|
||||
|
||||
certificate_arn = aws_acm_certificate_validation.sample.certificate_arn
|
||||
default_action {
|
||||
type = "forward"
|
||||
target_group_arn = aws_lb_target_group.alpha_cluster.arn
|
||||
|
Loading…
Reference in New Issue
Block a user