Skip to content

Commit

Permalink
[Improvement] ecs/service-* - Adding custom health check paths for ALB (
Browse files Browse the repository at this point in the history
  • Loading branch information
thenamanpatwari authored Jul 8, 2022
1 parent ae09f51 commit a6a08af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ecs/service-cluster-alb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Metadata:
- MaxCapacity
- MinCapacity
- HealthCheckGracePeriod
- HealthCheckPath
- Label:
default: 'Permission Parameters'
Parameters:
Expand Down Expand Up @@ -133,6 +134,10 @@ Parameters:
Default: 60
MinValue: 0
MaxValue: 1800
HealthCheckPath:
Description: 'Path of health check'
Type: String
Default: '/'
Conditions:
HasPermissionsBoundary: !Not [!Equals [!Ref PermissionsBoundary, '']]
HasLoadBalancerHttps: !Equals [!Ref LoadBalancerHttps, 'true']
Expand Down Expand Up @@ -191,7 +196,7 @@ Resources:
Type: 'AWS::ElasticLoadBalancingV2::TargetGroup'
Properties:
HealthCheckIntervalSeconds: 15
HealthCheckPath: '/'
HealthCheckPath: !Ref HealthCheckPath
HealthCheckProtocol: HTTP
HealthCheckTimeoutSeconds: 10
HealthyThresholdCount: 2
Expand Down
8 changes: 7 additions & 1 deletion ecs/service-dedicated-alb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Metadata:
- MaxCapacity
- MinCapacity
- HealthCheckGracePeriod
- HealthCheckPath
- Label:
default: 'Permission Parameters'
Parameters:
Expand Down Expand Up @@ -142,6 +143,11 @@ Parameters:
Default: 60
MinValue: 0
MaxValue: 1800
HealthCheckPath:
Description: 'Path of health check'
Type: String
Default: '/'

Conditions:
HasPermissionsBoundary: !Not [!Equals [!Ref PermissionsBoundary, '']]
HasAuthProxySecurityGroup: !Not [!Equals [!Ref ParentAuthProxyStack, '']]
Expand Down Expand Up @@ -248,7 +254,7 @@ Resources:
Type: 'AWS::ElasticLoadBalancingV2::TargetGroup'
Properties:
HealthCheckIntervalSeconds: 15
HealthCheckPath: '/'
HealthCheckPath: !Ref HealthCheckPath
HealthCheckProtocol: HTTP
HealthCheckTimeoutSeconds: 10
HealthyThresholdCount: 2
Expand Down

0 comments on commit a6a08af

Please sign in to comment.