Skip to content

Commit

Permalink
fix: responseTime should respect import ALB (#5564)
Browse files Browse the repository at this point in the history
Fixes #5557


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
  • Loading branch information
iamhopaul123 authored Dec 19, 2023
1 parent be03ed1 commit a2c99e0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ environments:
- path: "/"
allowed_source_ips: ["67.170.82.40/32", "0.0.0.0/0"]
alias: example.com
count:
response_time: 2s
network:
vpc:
security_groups:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,25 @@ Resources: # If a bucket URL is specified, that means the template exists.
ScaleInCooldown: 120
ScaleOutCooldown: 150
TargetValue: 70
AutoScalingPolicyALBAverageResponseTime:
Type: AWS::ApplicationAutoScaling::ScalingPolicy
Properties:
PolicyName: !Join ['-', [!Ref WorkloadName, ALBAverageResponseTime, ScalingPolicy]]
PolicyType: TargetTrackingScaling
ScalingTargetId: !Ref AutoScalingTarget
TargetTrackingScalingPolicyConfiguration:
CustomizedMetricSpecification:
Dimensions:
- Name: LoadBalancer
Value: mockImportALBName
- Name: TargetGroup
Value: !GetAtt TargetGroupForImportedALB.TargetGroupFullName
MetricName: TargetResponseTime
Namespace: AWS/ApplicationELB
Statistic: Average
ScaleInCooldown: 120
ScaleOutCooldown: 60
TargetValue: 2
EnvControllerAction:
Metadata:
'aws:copilot:description': "Update your environment's shared resources"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ AutoScalingPolicyALBAverageResponseTime:
Value: !GetAtt EnvControllerAction.PublicLoadBalancerFullName
{{- end}}
- Name: TargetGroup
{{- if $.ImportedALB}}
Value: !GetAtt TargetGroupForImportedALB.TargetGroupFullName
{{- else}}
Value: !GetAtt TargetGroup.TargetGroupFullName
{{- end}}
MetricName: TargetResponseTime
Namespace: AWS/ApplicationELB
Statistic: Average
Expand Down

0 comments on commit a2c99e0

Please sign in to comment.