aws / aws/aws-cdk

(aws-cloudfront): Official tsconfig for CloudFront functions runtimes

Open
#36,900 1 comment 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-cloudfront effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

Dev/build time confirmation that I'm using syntax that is valid for the given CF Function runtime version.

### Use Case

For example, I'm writing some code for runtime version 1 and i declare a `const`, I do not want to wait until the actual first invocation of the function to be alerted that runtime version 1 doesn't support that.

### Proposed Solution

Ship a tsconfig for both runtimes either in an AWS-owned package or in the popular [tsconfig/bases](https://github.com/tsconfig/bases/tree/main/bases) that codifies the features documented in the [AWS Docs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-javascript-runtime-features.html).

### Other Information

* [Related issue](https://github.com/aws/aws-cdk/issues/30475) that requests bundler support, potentially to achieve similar ends
* [Related article](https://repost.aws/questions/QUyiUmFAvYQaylmG_UkfJZrA/creating-a-cloudfront-function-in-typescript-using-the-cdk) on authoring CloudFront functions with typescript
* [Related package](https://www.npmjs.com/package/@types/aws-cloudfront-function) that provides types for CloudFront functions

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

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

2.236.0

### AWS CDK CLI version

2.1104.0

### Environment details (OS name and version, etc.)

MacOS 26

Contributor guide

Open the contributing guide

Research direction

Start with the AWS documentation for CloudFront Functions JavaScript runtime features and review the related bundler issue and @types/aws-cloudfront-function package. Decide where the two runtime-specific tsconfigs should live, then define the supported syntax for each runtime and verify that TypeScript rejects unsupported features.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
build-system, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.