Skip to content

Don't report E3049 when HealthCheckPort is omitted - #4829

Merged
kddejong merged 1 commit into
aws-cloudformation:mainfrom
Neg23:fix-e3049-omitted-healthcheckport
Oct 22, 2026
Merged

kddejong merged 1 commit into
aws-cloudformation:mainfrom
Neg23:fix-e3049-omitted-healthcheckport

Conversation

@Neg23

@Neg23 Neg23 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available: Fixes #4825

Description of changes:

E3049 reported a target group that doesn't set HealthCheckPort. For HTTP, HTTPS, TCP, TLS, UDP, TCP_UDP, QUIC and TCP_QUIC target groups the omitted property defaults to traffic-port (docs), so the template is valid.

  • When HealthCheckPort is omitted, the rule now looks at the target group Protocol and only reports when the protocol is known to have a different default (for example GENEVE).
  • When Protocol is missing or set with a function, the rule doesn't report, since the default can't be determined.
  • The explicit-port case from Got E3002 error in 1.9.0 version,  #3542 (for example HealthCheckPort: "8088") is still reported.

Tests: updated the existing omitted-HealthCheckPort case (HTTP, now no error) and added cases for GENEVE (still reported) and a Ref protocol (not reported).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

For HTTP, HTTPS, TCP, TLS, UDP, TCP_UDP, QUIC and TCP_QUIC target groups an omitted HealthCheckPort defaults to traffic-port, so the template is valid. Only report a missing HealthCheckPort when the protocol is known to have a different default.

Fixes aws-cloudformation#4825
@kddejong
kddejong force-pushed the fix-e3049-omitted-healthcheckport branch from 006e539 to a3f49e4 Compare October 22, 2026 15:08
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.67%. Comparing base (e8f395b) to head (a3f49e4).

Files with missing lines Patch % Lines
...cfnlint/rules/resources/ecs/ServiceDynamicPorts.py 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4829      +/-   ##
==========================================
- Coverage   94.68%   94.67%   -0.01%     
==========================================
  Files         439      439              
  Lines       15973    15984      +11     
  Branches     3097     3100       +3     
==========================================
+ Hits        15124    15133       +9     
- Misses        467      468       +1     
- Partials      382      383       +1     
Flag Coverage Δ
unittests 94.66% <81.81%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kddejong
kddejong merged commit b243e79 into aws-cloudformation:main Oct 22, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E3049 false positive when HealthCheckPort is omitted (default traffic-port)

2 participants