cloudformation-coverage-roadmap icon indicating copy to clipboard operation
cloudformation-coverage-roadmap copied to clipboard

Cannot add LoadBalancers and HealthCheckGracePeriodSeconds at the same time to an existing ECS Service

Open corymhall opened this issue 2 years ago • 0 comments

Name of the resource

AWS::ECS::Service

Resource Name

No response

Issue Description

If you create an ECS service without LoadBalancers

{
  "Resources": {
    "Service": {
      "Type": "AWS::ECS::Service",
      "Properties": {
        "Cluster": "...",
        "TaskDefinition": "...",
        "NetworkConfiguration": "..."
    }
  }
}

And then you update the Service to include both the LoadBalancers and the HealthCheckGracePeriodSeconds properties

{
  "Resources": {
    "Service": {
      "Type": "AWS::ECS::Service",
      "Properties": {
        "Cluster": "...",
        "TaskDefinition": "...",
        "NetworkConfiguration": {...},
        "LoadBalancers": [...],
        "HealthCheckGracePeriodSeconds": 60
    }
  }
}

The deployment will fail with the error Resource handler returned message: "Invalid request provided: UpdateService error: Health check grace period is only valid for services configured to use load balancers

If you deploy only the LoadBalancers property then it will succeed.

Expected Behavior

You should be able to deploy any property update together.

Observed Behavior

The deployment will fail with the error Resource handler returned message: "Invalid request provided: UpdateService error: Health check grace period is only valid for services configured to use load balancers

Test Cases

N/A

Other Details

No response

corymhall avatar Sep 08 '22 18:09 corymhall