From c06bf37a082a0fc49ff1178892d783c1a1309efd Mon Sep 17 00:00:00 2001 From: Gunnar Abrahamsson Date: Wed, 10 May 2023 10:56:20 +0200 Subject: [PATCH 1/6] Update Setting SSL termination by Load Balancer --- cloud/ecs-integration.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/cloud/ecs-integration.md b/cloud/ecs-integration.md index fbda6dbeefb..18aa136eee4 100644 --- a/cloud/ecs-integration.md +++ b/cloud/ecs-integration.md @@ -485,10 +485,24 @@ services: image: acme/webapp ports: - "80:80" + - "443:443" x-aws-cloudformation: Resources: - WebappTCP80Listener: + WebTCP80Listener: + Properties: + DefaultActions: + - Type: redirect + RedirectConfig: + Host: '#{host}' + Path: '/#{path}' + Port: '443' + Protocol: 'HTTPS' + Query: '#{query}' + StatusCode: 'HTTP_301' + Protocol: HTTP + Port: 80 + WebappTCP443Listener: Properties: Certificates: - CertificateArn: "arn:aws:acm:certificate/123abc" From 4eb691894b433457a088e238994d0db5698e5b56 Mon Sep 17 00:00:00 2001 From: Gunnar Abrahamsson Date: Wed, 10 May 2023 11:22:24 +0200 Subject: [PATCH 2/6] Fixed a typo --- cloud/ecs-integration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/ecs-integration.md b/cloud/ecs-integration.md index 18aa136eee4..ae12697b1b1 100644 --- a/cloud/ecs-integration.md +++ b/cloud/ecs-integration.md @@ -502,7 +502,7 @@ x-aws-cloudformation: StatusCode: 'HTTP_301' Protocol: HTTP Port: 80 - WebappTCP443Listener: + WebTCP443Listener: Properties: Certificates: - CertificateArn: "arn:aws:acm:certificate/123abc" From 0dcc24bc99248ed9ccdab07563b7fda1de859d8e Mon Sep 17 00:00:00 2001 From: Gunnar Abrahamsson Date: Wed, 10 May 2023 11:29:09 +0200 Subject: [PATCH 3/6] Fixed another typo --- cloud/ecs-integration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/ecs-integration.md b/cloud/ecs-integration.md index ae12697b1b1..078fe129abf 100644 --- a/cloud/ecs-integration.md +++ b/cloud/ecs-integration.md @@ -489,7 +489,7 @@ services: x-aws-cloudformation: Resources: - WebTCP80Listener: + WebappTCP80Listener: Properties: DefaultActions: - Type: redirect @@ -502,7 +502,7 @@ x-aws-cloudformation: StatusCode: 'HTTP_301' Protocol: HTTP Port: 80 - WebTCP443Listener: + WebappTCP443Listener: Properties: Certificates: - CertificateArn: "arn:aws:acm:certificate/123abc" From 0a04608b6236c3c279b4e1d94fea03516aa10dcb Mon Sep 17 00:00:00 2001 From: Gunnar Abrahamsson Date: Thu, 11 May 2023 13:26:30 +0200 Subject: [PATCH 4/6] added LoadBalancerArn & DefaultActions --- cloud/ecs-integration.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cloud/ecs-integration.md b/cloud/ecs-integration.md index 078fe129abf..2f8488c23c4 100644 --- a/cloud/ecs-integration.md +++ b/cloud/ecs-integration.md @@ -485,7 +485,6 @@ services: image: acme/webapp ports: - "80:80" - - "443:443" x-aws-cloudformation: Resources: @@ -506,8 +505,17 @@ x-aws-cloudformation: Properties: Certificates: - CertificateArn: "arn:aws:acm:certificate/123abc" + DefaultActions: + - Type: forward + ForwardConfig: + TargetGroups: + - TargetGroupArn: + Ref: WebappTCP80TargetGroup Protocol: HTTPS Port: 443 + LoadBalancerArn: + Ref: LoadBalancer + Type: AWS::ElasticLoadBalancingV2::Listener ``` ## Using existing AWS network resources From 0cc69ca81149df33b094515a4156602f9d9bc549 Mon Sep 17 00:00:00 2001 From: Gunnar Abrahamsson Date: Thu, 11 May 2023 15:45:31 +0200 Subject: [PATCH 5/6] Added port 443 to fix dns time out --- cloud/ecs-integration.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cloud/ecs-integration.md b/cloud/ecs-integration.md index 2f8488c23c4..775f0392352 100644 --- a/cloud/ecs-integration.md +++ b/cloud/ecs-integration.md @@ -485,6 +485,7 @@ services: image: acme/webapp ports: - "80:80" + - "443:443" x-aws-cloudformation: Resources: From f1c22fc9d4340d0df947ccc9b3d043ba8cef75b2 Mon Sep 17 00:00:00 2001 From: Gunnar Abrahamsson Date: Thu, 11 May 2023 16:42:14 +0200 Subject: [PATCH 6/6] removed port 443 & added Default443Ingress config --- cloud/ecs-integration.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cloud/ecs-integration.md b/cloud/ecs-integration.md index 775f0392352..f584ef733e0 100644 --- a/cloud/ecs-integration.md +++ b/cloud/ecs-integration.md @@ -485,7 +485,6 @@ services: image: acme/webapp ports: - "80:80" - - "443:443" x-aws-cloudformation: Resources: @@ -517,6 +516,16 @@ x-aws-cloudformation: LoadBalancerArn: Ref: LoadBalancer Type: AWS::ElasticLoadBalancingV2::Listener + Default443Ingress: + Properties: + CidrIp: 0.0.0.0/0 + Description: web:443/tcp on default network + FromPort: 443 + GroupId: + Ref: DefaultNetwork + IpProtocol: TCP + ToPort: 443 + Type: AWS::EC2::SecurityGroupIngress ``` ## Using existing AWS network resources