Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.
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
4 changes: 4 additions & 0 deletions .changelog/4767.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:bug
plugin/ecs: Set health check timeout and interval values to compatible default
values.
```
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ parameter {

parameter {
key = "health_check"
description = "Health check settings for the app."
description = "Health check settings for the app.\nThese settings configure a health check for the application target group."
type = "category"
required = false
}
Expand Down Expand Up @@ -151,10 +151,11 @@ parameter {
}

parameter {
key = "health_check.interval"
description = "The amount of time, in seconds, between health checks."
type = "int64"
required = false
key = "health_check.interval"
description = "The amount of time, in seconds, between health checks."
type = "int64"
required = false
default_value = "30"
}

parameter {
Expand All @@ -180,10 +181,11 @@ parameter {
}

parameter {
key = "health_check.timeout"
description = "The amount of time, in seconds, for which no target response means a failure."
type = "int64"
required = false
key = "health_check.timeout"
description = "The amount of time, in seconds, for which no target response means a failure. Must be lower than the interval."
type = "int64"
required = false
default_value = "5"
}

parameter {
Expand Down
15 changes: 13 additions & 2 deletions builtin/aws/ecs/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -1339,14 +1339,20 @@ func (p *Platform) resourceTargetGroupCreate(
createTargetGroupInput.HealthCheckPath = aws.String(p.config.HealthCheck.Path)
}

createTargetGroupInput.HealthCheckTimeoutSeconds = aws.Int64(5)
if p.config.HealthCheck.Timeout != 0 {
createTargetGroupInput.HealthCheckTimeoutSeconds = aws.Int64(p.config.HealthCheck.Timeout)
}

createTargetGroupInput.HealthCheckIntervalSeconds = aws.Int64(30)
if p.config.HealthCheck.Interval != 0 {
createTargetGroupInput.HealthCheckIntervalSeconds = aws.Int64(p.config.HealthCheck.Interval)
}

if *createTargetGroupInput.HealthCheckIntervalSeconds < *createTargetGroupInput.HealthCheckTimeoutSeconds {
return status.Errorf(codes.InvalidArgument, fmt.Sprintf("Health check interval cannot be shorter than the timeout"))
}

if p.config.HealthCheck.HealthyThresholdCount != 0 {
createTargetGroupInput.HealthyThresholdCount = aws.Int64(p.config.HealthCheck.HealthyThresholdCount)
} else {
Expand Down Expand Up @@ -3215,6 +3221,9 @@ deploy {

doc.SetField("health_check",
"Health check settings for the app.",
docs.Summary("These settings configure a health check for the application "+
"target group."),

docs.SubFields(func(doc *docs.SubFieldDoc) {
doc.SetField("protocol",
"The protocol for the health check to use.",
Expand All @@ -3225,10 +3234,12 @@ deploy {

doc.SetField("timeout",
"The amount of time, in seconds, for which no target response "+
"means a failure.")
"means a failure. Must be lower than the interval.",
docs.Default("5"))

doc.SetField("interval",
"The amount of time, in seconds, between health checks.")
"The amount of time, in seconds, between health checks.",
docs.Default("30"))

doc.SetField("healthy_threshold_count",
"The number of consecutive successful health checks required to"+
Expand Down