Describe the feature
Cloudfront functions support either "cloudfront-js-1.0" or "cloudfront-js-2.0" runtimes
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-javascript-runtime-features.html
Use Case
AWS provide example functions here: https://github.com/aws-samples/amazon-cloudfront-functions
Not all of them are cloudfront-js-1.0 v1 compatible; specifically I was using the URL rewrites and redirect example.
Proposed Solution
Add a new enum property to allow the user to choose which runtime is used.
Other Information
Available in cloudformation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html
Currently Hardcoded in CDK: https://github.com/aws/aws-cdk/blob/85cc0c686049ca40a0bc09589830a909e911fbdf/packages/aws-cdk-lib/aws-cloudfront/lib/function.ts#L168C19-L168C36
Acknowledgements
CDK version used
2.111.0
Environment details (OS name and version, etc.)
Linux
Describe the feature
Cloudfront functions support either "cloudfront-js-1.0" or "cloudfront-js-2.0" runtimes
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-javascript-runtime-features.html
Use Case
AWS provide example functions here: https://github.com/aws-samples/amazon-cloudfront-functions
Not all of them are cloudfront-js-1.0 v1 compatible; specifically I was using the URL rewrites and redirect example.
Proposed Solution
Add a new enum property to allow the user to choose which runtime is used.
Other Information
Available in cloudformation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html
Currently Hardcoded in CDK: https://github.com/aws/aws-cdk/blob/85cc0c686049ca40a0bc09589830a909e911fbdf/packages/aws-cdk-lib/aws-cloudfront/lib/function.ts#L168C19-L168C36
Acknowledgements
CDK version used
2.111.0
Environment details (OS name and version, etc.)
Linux