From c5b8e2f4a2bfce3a31ac365892fe3a13eed6a1de Mon Sep 17 00:00:00 2001 From: Joseph Manley Date: Sun, 3 Nov 2019 19:09:38 -0500 Subject: [PATCH] Expose port 7350 with HTTPS --- cloudformation/nakama/top.yaml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/cloudformation/nakama/top.yaml b/cloudformation/nakama/top.yaml index 5418aa8..404e0aa 100644 --- a/cloudformation/nakama/top.yaml +++ b/cloudformation/nakama/top.yaml @@ -176,6 +176,41 @@ Resources: ToPort: "65535" CidrIp: 0.0.0.0/0 + # Target group for HTTP api + HttpApiTargetGroup: + Type: AWS::ElasticLoadBalancingV2::TargetGroup + Properties: + HealthCheckIntervalSeconds: 30 + HealthCheckProtocol: HTTP + HealthCheckTimeoutSeconds: 15 + HealthyThresholdCount: 2 + UnhealthyThresholdCount: 2 + Matcher: + HttpCode: '200' + HealthCheckPath: '/' + Port: 7350 + Protocol: HTTP + TargetGroupAttributes: + - Key: deregistration_delay.timeout_seconds + Value: '20' + VpcId: !Ref 'VpcId' + Tags: + - Key: Name + Value: !Sub 'nakama-http-${release}' + + # HTTPS for HTTP Api + HttpApiAlbListener: + Type: AWS::ElasticLoadBalancingV2::Listener + Properties: + Certificates: + - CertificateArn: !Ref PortalCertificate + DefaultActions: + - Type: forward + TargetGroupArn: !Ref HttpApiTargetGroup + LoadBalancerArn: !Ref PublicALB + Port: 7350 + Protocol: HTTPS + # Target group for admin portal port AdminPortalTargetGroup: Type: AWS::ElasticLoadBalancingV2::TargetGroup