Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into slack-err-fixes
Browse files Browse the repository at this point in the history
* origin/master:
  Update ALB: Enabled HTTPS
  • Loading branch information
razzkumar committed Sep 25, 2019
2 parents a5cac96 + 87a206f commit 667e2fd
Showing 1 changed file with 32 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ provider "aws" {
# Fetch AZ in current Region
data "aws_availability_zones" "available" {}
data "aws_acm_certificate" "cert" {
domain = "*.shift.lftechnology.com"
}
resource "aws_vpc" "main" {
cidr_block = var.cidr_block
tags = var.tags
Expand Down Expand Up @@ -198,27 +201,40 @@ resource "aws_alb_target_group" "app" {
}
# Redirect all traffic from the ALB to the target group
//resource "aws_alb_listener" "my_website_https" {
// load_balancer_arn = aws_alb.main.id
// port = "443"
// protocol = "HTTPS"
// ssl_policy = "ELBSecurityPolicy-2016-08"
// certificate_arn = var.aws_acm_certificate_arn
// // tags = var.tags
// default_action {
// type = "forward"
// target_group_arn = aws_alb_target_group.app.id
// }
//}
resource "aws_alb_listener" "my_website_https" {
load_balancer_arn = aws_alb.main.id
port = "443"
protocol = "HTTPS"
ssl_policy = "ELBSecurityPolicy-2016-08"
certificate_arn = data.aws_acm_certificate.cert.arn
// tags = var.tags
default_action {
type = "forward"
target_group_arn = aws_alb_target_group.app.id
}
}
resource "aws_lb_listener" "my_website_http" {
load_balancer_arn = aws_alb.main.id
port = "80"
protocol = "HTTP"
default_action {
type = "forward"
target_group_arn = aws_alb_target_group.app.id
//default_action {
// type = "forward"
// target_group_arn = aws_alb_target_group.app.id
//}
default_action {
type = "redirect"
target_group_arn = aws_alb_target_group.app.id
redirect {
port = "443"
protocol = "HTTPS"
status_code = "HTTP_301"
host = "#{host}"
path = "/#{path}"
query = "#{query}"
}
}
}
//Fargate
Expand Down Expand Up @@ -434,7 +450,7 @@ output "appUrl" {
// Template
`

const ContainerTemplate = `[
const ContainerTemplate = `[
{
"name": "${fargate_container_name}",
"image": "${repo_name}",
Expand Down

0 comments on commit 667e2fd

Please sign in to comment.