aws / aws/aws-cdk

(aws-cloudfront): EdgeFunction should implement Edge specific lambda restrictions

Open
#22,019 2 comments 2 reactions 0 assignees View on GitHub
@aws-cdk/aws-cloudfront bug effort/small p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

Lambda environment variables are not supported by Lambda@Edge.

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-functions-restrictions.html#lambda-at-edge-runtime-restrictions

### Expected Behavior

EdgeFunctionProps should not allow the "environment" prop.

### Current Behavior

The stack fails to deploy when the "environment" prop is used.

### Reproduction Steps

Add the "environment" prop to EdgeFunction.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### CDK CLI Version

2.40.0

### Framework Version

_No response_

### Node.js Version

18

### OS

macOS

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating EdgeFunctionProps and EdgeFunction, then compare their current handling of the environment prop with the Lambda@Edge runtime restrictions linked in the issue. Reproduce the problem by adding environment to EdgeFunction and confirm that the completed change prevents this unsupported configuration from reaching deployment.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.