Skip to content

aws-cdk-lib/aws-ecs-patterns: setting maxHealthyPercent incorrectly causes stack to fail to deploy #26158

@cloventt

Description

@cloventt

Describe the bug

Setting the maxHealthyPercent on an ApplicationLoadBalancedFargateService to an invalid value does not raise a synth-time error, but it generates invalid CFN templates.

Expected Behavior

Setting the maxHealthyPercent on an ApplicationLoadBalancedFargateService to a value such as 0.5 should trigger a compile-time error.

Current Behavior

The invalid config is synthed without raising any warnings and results in the stack failing to apply.

Reproduction Steps

Setting the maxHealthyPercent on an ApplicationLoadBalancedFargateService to a value such as 0.5.

Possible Solution

Throw an exception at synth-time if maxHealthyPercent is not a whole integer between 0 and 100 inclusive.

Additional Information/Context

No response

CDK CLI Version

2.79.1

Framework Version

No response

Node.js Version

19.1.0

OS

Linux

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/triggersRelated to the triggers packagebugThis issue is a bug.effort/smallSmall work item – less than a day of effortgood first issueRelated to contributions. See CONTRIBUTING.mdp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions