Skip to content

aws-ecs-patterns: Health Check Interval > Timeout Fails On Deploy #29062

@tmmvn

Description

@tmmvn

Describe the bug

When configuring ApplicationLoadBalancedFargateService targetGroup.configureHealthCheck, it is possible to have deployment fail with "Health check interval must be greater
than the timeout.". This should fail during synthesis as the values are known at that time.

Expected Behavior

I expected my deployment to succeed, or the error to be caught during synthesis.

Current Behavior

Stack was synthesized successfully, but the deployment failed.

Reproduction Steps

Create a new ApplicationLoadBalancedFargateService:

import * as ecsp from "aws-cdk-lib/aws-ecs-patterns";
const imageProps = {
            image: ecs.ContainerImage.fromRegistry(ADDSOMEIMAGEHERE),
            containerPort: 3000,
        };
        const fargateProps = {
            assignPublicIp: true,
            cpu: 512,
            desiredCount: 1,
            memoryLimitMiB: 1024,
            publicLoadBalancer: true,
            taskImageOptions: imageProps,
        };
const ecsService = new ecsp.ApplicationLoadBalancedFargateService(
            this,
            parentId + "Server",
            fargateProps,
        );

Then apply the following:

ecsService.targetGroup.configureHealthCheck({
            timeout: cdk.Duration.seconds(60),
        })

Possible Solution

Synthesis should check the interval of the health check is larger than the timeout.

Additional Information/Context

No response

CDK CLI Version

2.126.0

Framework Version

No response

Node.js Version

18.18.2

OS

macOS 14.3.1

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ecs-patternsRelated to ecs-patterns librarybugThis issue is a bug.effort/mediumMedium work item – several days of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions