aws / aws/aws-cdk

aws-s3-deployment: BucketDeployment creates Lambda function with unsupported runtime

Open
#34,372 8 comments 1 reaction 0 assignees View on GitHub
@aws-cdk/aws-s3-deployment feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### Describe the bug

When using the BucketDeployment a lambda will be created using an old runtime version of python. This causes the AwsSolutions-L1 to complain stating that a non-container Lambda function is not configured to use the latest runtime version.

This seems to be a repeat of this issue: https://github.com/aws/aws-cdk/issues/21470

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Library Version

_No response_

### Expected Behavior

The BucketDeployment should either let me control which runtime it uses, or default to the latest.

### Current Behavior

BucketDeployment is using an old runtime and this causes CDK deployments to fail.

### Reproduction Steps

aws-cdk: 2.1013.0
aws-cdk-lib: 2.194.0

Attempt to create a BucketDeployment and an error will be thrown stating:

"AwsSolutions-L1: The non-container Lambda function is not configured to use the latest runtime version. Use the latest available runtime for the targeted language to avoid technical debt. Runtimes specific to a language or framework version are deprecated when the version reaches end of life. This rule only applies to non-container Lambda functions."

### Possible Solution

Let me control the runtime, or update the runtime to use the latest that the CDK cli is expecting.

### Additional Information/Context

_No response_

### AWS CDK Library version (aws-cdk-lib)

2.194.0

### AWS CDK CLI version

2.1013.0

### Node.js Version

22

### OS

macOS Sequoia 15.4.1

### Language

TypeScript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the BucketDeployment entry point and follow where its Lambda runtime is selected. Compare that path with the reported AwsSolutions-L1 expectation and verify the behavior using a minimal BucketDeployment reproduction; done means the generated function uses a supported runtime or exposes the requested runtime control without triggering the finding.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.