Skip to content

Add E3717 for Lambda Timeout limit based on CapacityProviderConfig - #4685

Merged
kddejong merged 1 commit into
aws-cloudformation:mainfrom
kddejong:feat/lambda-capacity-provider-timeout
Sep 9, 2026
Merged

kddejong merged 1 commit into
aws-cloudformation:mainfrom
kddejong:feat/lambda-capacity-provider-timeout

Conversation

@kddejong

@kddejong kddejong commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available: N/A

Description of changes:

Adds rule E3717 to validate the Timeout property of AWS::Lambda::Function based on whether the function uses a capacity provider (Lambda Managed Instances).

The maximum Timeout of 900 seconds only applies to functions without CapacityProviderConfig. Functions using Lambda Managed Instances (via CapacityProviderConfig) can specify a Timeout up to 5400 seconds. The resource schema only enforces the flat 5400-second maximum, so this rule adds the conditional 900-second maximum for functions that do not use a capacity provider.

Behavior:

Function Timeout Result
No CapacityProviderConfig 900 valid
No CapacityProviderConfig > 900 E3717
CapacityProviderConfig present <= 5400 valid
CapacityProviderConfig present > 5400 E3034 (schema maximum)

Implementation follows the existing conditional-maximum pattern (e.g. E3718 for API Gateway AuthorizerResultTtlInSeconds): a small if/then schema extension plus a rule class. This behavior was verified against the live Lambda CreateFunction API.

Includes unit tests and a docs/rules.md entry.

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

Lambda functions without CapacityProviderConfig have a maximum Timeout
of 900 seconds. Functions using Lambda Managed Instances (via
CapacityProviderConfig) can specify a Timeout up to 5400 seconds.

The resource schema only enforces the flat 5400-second maximum, so this
rule adds the conditional 900-second maximum for functions that do not
use a capacity provider.
@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.65%. Comparing base (00c36e3) to head (bfa8934).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4685   +/-   ##
=======================================
  Coverage   94.64%   94.65%           
=======================================
  Files         433      434    +1     
  Lines       15512    15528   +16     
  Branches     3011     3011           
=======================================
+ Hits        14682    14698   +16     
  Misses        453      453           
  Partials      377      377           
Flag Coverage Δ
unittests 94.65% <100.00%> (+<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 0f15d38 into aws-cloudformation:main Sep 9, 2026
22 checks passed
@kddejong
kddejong deleted the feat/lambda-capacity-provider-timeout branch September 9, 2026 14:25
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.

1 participant