Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix least connection algorithm type #267

Merged
merged 17 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions cloudformation/antmedia-aws-autoscale-remote_db-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Resources:
AMSGetLatestAMI:
Type: AWS::Lambda::Function
Properties:
Runtime: python3.8
Runtime: python3.11
Handler: index.handler
Role: !Sub ${DescribeImagesRole.Arn}
Timeout: 60
Expand Down Expand Up @@ -364,6 +364,8 @@ Resources:

RTMPLoadBalancer:
Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
DependsOn:
- InternetGatewayAttachment
Properties:
Subnets:
- !Ref OriginZone
Expand Down Expand Up @@ -616,6 +618,11 @@ Resources:
FromPort: 5443
ToPort: 5443
Description: Allow 5443. Port for Edge Instances
- CidrIp: 0.0.0.0/0
IpProtocol: tcp
FromPort: 4444
ToPort: 4444
Description: Allow 4444. Port for accessing Dashboard

ApplicationLoadBalancer:
Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
Expand Down Expand Up @@ -647,6 +654,17 @@ Resources:
LoadBalancerArn: !Ref ApplicationLoadBalancer
Port: '5443'
Protocol: HTTPS
ALBListener4444:
Type: 'AWS::ElasticLoadBalancingV2::Listener'
Properties:
Certificates:
- CertificateArn: !Ref LoadBalancerCertificateArn
DefaultActions:
- Type: forward
TargetGroupArn: !Ref ALBTargetGroupOrigin
LoadBalancerArn: !Ref ApplicationLoadBalancer
Port: '4444'
Protocol: HTTPS
ALBListener5080:
Type: 'AWS::ElasticLoadBalancingV2::Listener'
Properties:
Expand Down Expand Up @@ -695,12 +713,6 @@ Resources:
UnhealthyThresholdCount: 5
VpcId: !Ref AntMediaVPC
TargetGroupAttributes:
- Key: stickiness.enabled
Value: 'true'
- Key: stickiness.type
Value: lb_cookie
- Key: stickiness.lb_cookie.duration_seconds
Value: '30'
- Key: load_balancing.algorithm.type
Value: least_outstanding_requests
OriginRule:
Expand Down Expand Up @@ -780,6 +792,15 @@ Resources:

Outputs:

Dashboard:
Description: Dashboard Login URL
Value: !Join
- ''
- - 'https://'
- !GetAtt
- ApplicationLoadBalancer
- DNSName

OriginHTTPS:
Description: HTTPS URL of the Ant Media Origin Servers
Value: !Join
Expand Down
39 changes: 29 additions & 10 deletions cloudformation/antmedia-aws-autoscale-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Resources:
AMSGetLatestAMI:
Type: AWS::Lambda::Function
Properties:
Runtime: python3.8
Runtime: python3.11
Handler: index.handler
Role: !Sub ${DescribeImagesRole.Arn}
Timeout: 60
Expand Down Expand Up @@ -296,7 +296,7 @@ Resources:
UbuntuGetLatestAMI:
Type: AWS::Lambda::Function
Properties:
Runtime: python3.8
Runtime: python3.11
Handler: index.handler
Role: !Sub ${DescribeImagesRole.Arn}
Timeout: 60
Expand Down Expand Up @@ -433,6 +433,8 @@ Resources:

RTMPLoadBalancer:
Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
DependsOn:
- InternetGatewayAttachment
Properties:
Subnets:
- !Ref OriginZone
Expand All @@ -448,8 +450,6 @@ Resources:
Protocol: TCP
RTMPTargetGroup:
Type: 'AWS::ElasticLoadBalancingV2::TargetGroup'
DependsOn:
- InternetGatewayAttachment
Properties:
HealthCheckIntervalSeconds: 30
HealthyThresholdCount: 3
Expand Down Expand Up @@ -652,6 +652,11 @@ Resources:
FromPort: 5443
ToPort: 5443
Description: Allow 5443. Port for Edge Instances
- CidrIp: 0.0.0.0/0
IpProtocol: tcp
FromPort: 4444
ToPort: 4444
Description: Allow 4444. Port for accessing Dashboard

ApplicationLoadBalancer:
Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
Expand Down Expand Up @@ -685,6 +690,17 @@ Resources:
LoadBalancerArn: !Ref ApplicationLoadBalancer
Port: '5443'
Protocol: HTTPS
ALBListener4444:
Type: 'AWS::ElasticLoadBalancingV2::Listener'
Properties:
Certificates:
- CertificateArn: !Ref LoadBalancerCertificateArn
DefaultActions:
- Type: forward
TargetGroupArn: !Ref ALBTargetGroupOrigin
LoadBalancerArn: !Ref ApplicationLoadBalancer
Port: '4444'
Protocol: HTTPS
ALBListener5080:
Type: 'AWS::ElasticLoadBalancingV2::Listener'
Properties:
Expand Down Expand Up @@ -737,12 +753,6 @@ Resources:
UnhealthyThresholdCount: 5
VpcId: !Ref AntMediaVPC
TargetGroupAttributes:
- Key: stickiness.enabled
Value: 'true'
- Key: stickiness.type
Value: lb_cookie
- Key: stickiness.lb_cookie.duration_seconds
Value: '30'
- Key: load_balancing.algorithm.type
Value: least_outstanding_requests
OriginRule:
Expand Down Expand Up @@ -864,6 +874,15 @@ Resources:

Outputs:

Dashboard:
Description: Dashboard Login URL
Value: !Join
- ''
- - 'https://'
- !GetAtt
- ApplicationLoadBalancer
- DNSName

OriginHTTPS:
Description: HTTPS URL of the Ant Media Origin Servers
Value: !Join
Expand Down
37 changes: 29 additions & 8 deletions cloudformation/antmedia-aws-autoscale-with-monitoring-tool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ Resources:
AMSGetLatestAMI:
Type: AWS::Lambda::Function
Properties:
Runtime: python3.8
Runtime: python3.11
Handler: index.handler
Role: !Sub ${DescribeImagesRole.Arn}
Timeout: 60
Expand Down Expand Up @@ -347,7 +347,7 @@ Resources:
UbuntuGetLatestAMI:
Type: AWS::Lambda::Function
Properties:
Runtime: python3.8
Runtime: python3.11
Handler: index.handler
Role: !Sub ${DescribeImagesRole.Arn}
Timeout: 60
Expand Down Expand Up @@ -484,6 +484,8 @@ Resources:

RTMPLoadBalancer:
Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
DependsOn:
- InternetGatewayAttachment
Properties:
Subnets:
- !Ref OriginZone
Expand Down Expand Up @@ -701,6 +703,11 @@ Resources:
FromPort: 5443
ToPort: 5443
Description: Allow 5443. Port for Edge Instances
- CidrIp: 0.0.0.0/0
IpProtocol: tcp
FromPort: 4444
ToPort: 4444
Description: Allow 4444. Port for accessing Dashboard

ApplicationLoadBalancer:
Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
Expand Down Expand Up @@ -734,6 +741,17 @@ Resources:
LoadBalancerArn: !Ref ApplicationLoadBalancer
Port: '5443'
Protocol: HTTPS
ALBListener4444:
Type: 'AWS::ElasticLoadBalancingV2::Listener'
Properties:
Certificates:
- CertificateArn: !Ref LoadBalancerCertificateArn
DefaultActions:
- Type: forward
TargetGroupArn: !Ref ALBTargetGroupOrigin
LoadBalancerArn: !Ref ApplicationLoadBalancer
Port: '4444'
Protocol: HTTPS
ALBListener5080:
Type: 'AWS::ElasticLoadBalancingV2::Listener'
Properties:
Expand Down Expand Up @@ -786,12 +804,6 @@ Resources:
UnhealthyThresholdCount: 5
VpcId: !Ref AntMediaVPC
TargetGroupAttributes:
- Key: stickiness.enabled
Value: 'true'
- Key: stickiness.type
Value: lb_cookie
- Key: stickiness.lb_cookie.duration_seconds
Value: '30'
- Key: load_balancing.algorithm.type
Value: least_outstanding_requests
OriginRule:
Expand Down Expand Up @@ -1081,6 +1093,15 @@ Resources:
InstanceId: !Ref MonitorInstance

Outputs:

Dashboard:
Description: Dashboard Login URL
Value: !Join
- ''
- - 'https://'
- !GetAtt
- ApplicationLoadBalancer
- DNSName

OriginHTTPS:
Description: HTTPS URL of the Ant Media Origin Servers
Expand Down