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

update ecs_service max grace period to 2147483647 #7806

Merged
merged 2 commits into from
Mar 6, 2019
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
3 changes: 2 additions & 1 deletion aws/resource_aws_ecs_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"log"
"math"
"strings"
"time"

Expand Down Expand Up @@ -62,7 +63,7 @@ func resourceAwsEcsService() *schema.Resource {
"health_check_grace_period_seconds": {
Type: schema.TypeInt,
Optional: true,
ValidateFunc: validation.IntBetween(0, 7200),
ValidateFunc: validation.IntBetween(0, math.MaxInt32),
},

"launch_type": {
Expand Down
11 changes: 10 additions & 1 deletion aws/resource_aws_ecs_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package aws
import (
"fmt"
"log"
"math"
"regexp"
"testing"
"time"
Expand Down Expand Up @@ -323,7 +324,7 @@ func TestAccAWSEcsService_healthCheckGracePeriodSeconds(t *testing.T) {
},
{
Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(vpcNameTag, clusterName, tdName,
roleName, policyName, lbName, svcName, 7201),
roleName, policyName, lbName, svcName, math.MaxInt32+1),
ExpectError: regexp.MustCompile(`expected health_check_grace_period_seconds to be in the range`),
},
{
Expand All @@ -342,6 +343,14 @@ func TestAccAWSEcsService_healthCheckGracePeriodSeconds(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "health_check_grace_period_seconds", "600"),
),
},
{
Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(vpcNameTag, clusterName, tdName,
roleName, policyName, lbName, svcName, math.MaxInt32),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSEcsServiceExists(resourceName, &service),
resource.TestCheckResourceAttr(resourceName, "health_check_grace_period_seconds", "2147483647"),
),
},
},
})
}
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/ecs_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The following arguments are supported:
* `enable_ecs_managed_tags` - (Optional) Specifies whether to enable Amazon ECS managed tags for the tasks within the service.
* `propagate_tags` - (Optional) Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`.
* `ordered_placement_strategy` - (Optional) Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. The maximum number of `ordered_placement_strategy` blocks is `5`. Defined below.
* `health_check_grace_period_seconds` - (Optional) Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 7200. Only valid for services configured to use load balancers.
* `health_check_grace_period_seconds` - (Optional) Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers.
* `load_balancer` - (Optional) A load balancer block. Load balancers documented below.
* `placement_constraints` - (Optional) rules that are taken into consideration during task placement. Maximum number of
`placement_constraints` is `10`. Defined below.
Expand Down