-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-cloudfront: Support cloudfront-js-2.0 runtime #28163
Comments
The PR has already been submitted👍 |
Awesome! Can't wait to see the 2.0 runtime support in CDK. |
Great. Can't wait! |
Before we have L2 support, you should be able to enable this feature like this: const cfFunction = new aws_cloudfront.Function(this, 'Function', {
...
});
(cfFunction.node.defaultChild as aws_cloudfront.CfnFunction).addPropertyOverride("FunctionConfig.Runtime", "cloudfront-js-2.0") |
fixed #28163 This provides an option to change the runtime for CloudFront Functions. This makes it easier to access the CloudFront KeyValueStore. https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
fixed aws#28163 This provides an option to change the runtime for CloudFront Functions. This makes it easier to access the CloudFront KeyValueStore. https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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
The text was updated successfully, but these errors were encountered: