title: Using a S3 Static Site with an Application Load Balancer
body: <p>I have an ALB that currently routes traffic to multiple urls. I'd like to be able to route traffic to a Static S3 site in the event that we need to perform maintenance. We would then display a static "Maintenance" page instead of our login page.</p>
  
  <p>I have created a CloudFront Distribution that allows a S3 site to be loaded with an SSL cert but I am not sure how to connect that distribution to send all of the traffic to the S3 maintenance site.</p>
  
  <p>This is the Terraform ALB listener I'm using. Can I specify my CloudFront distribution <code>arn</code> at the <code>target_group</code> and have it route all traffic to the static site? </p>
  
  <p>Or could I simply link my S3 <code>arn</code> here with an S3 policy allowing the ALB access to get the bucket objects?</p>
  
  <pre><code>resource "aws_alb_listener" "ssl_alb_httpslistener" {
     load_balancer_arn = "${aws_alb.alb_lis.arn}"
     port = "443"
     protocol = "HTTPS"
     ssl_policy = "Sec-TLS"
     certificate_arn = "${var.ssl_cert_arn}"
  
      default_action {
       target_group_arn = "${data.terraform_remote_state.php.target_arn}"
       type = "forward"
     }
  }
  </code></pre>
  
  <p>I would I expect that I could route traffic that passes through an ALB to a Static S3 site from the <code>target_group</code>. Curious if this is the best way to go about this.</p>