-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
‼️ NOTICE: S3 notifications fail to deploy on version 1.94.0 - ZipFile can only be used when Runtime is set to either of nodejs8.10... #13620
Comments
Seems to be related to aws-cloudformation/cloudformation-coverage-roadmap#80 |
@yurynix Thanks for reporting this. We are looking into it. |
Yeap, confirmed. Until we release a patch, you can use the following workaround: const handler = Stack.of(this).node.tryFindChild('BucketNotificationsHandler050a0587b7544547bf325f094a3db834')?.node.defaultChild as cdk.CfnResource
handler.addPropertyOverride("Runtime", "nodejs12.x"); Apologies for this. |
#13624) This [PR](#13488) upgraded our Node runtimes from `10` to `14`. The problem is that Node14 isn't supported for lambda functions using inline code (i.e `ZipFile`). Change to Node12 specifically for the notification handler since it's the only one using `InlineLambda`. Fixes #13620 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
#13624) This [PR](#13488) upgraded our Node runtimes from `10` to `14`. The problem is that Node14 isn't supported for lambda functions using inline code (i.e `ZipFile`). Change to Node12 specifically for the notification handler since it's the only one using `InlineLambda`. Fixes #13620 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
A patch has been released: https:/aws/aws-cdk/releases/tag/v1.94.1 |
Thank you for the quick turnaround 🙂 |
aws#13624) This [PR](aws#13488) upgraded our Node runtimes from `10` to `14`. The problem is that Node14 isn't supported for lambda functions using inline code (i.e `ZipFile`). Change to Node12 specifically for the notification handler since it's the only one using `InlineLambda`. Fixes aws#13620 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
aws#13624) This [PR](aws#13488) upgraded our Node runtimes from `10` to `14`. The problem is that Node14 isn't supported for lambda functions using inline code (i.e `ZipFile`). Change to Node12 specifically for the notification handler since it's the only one using `InlineLambda`. Fixes aws#13620 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
aws#13624) This [PR](aws#13488) upgraded our Node runtimes from `10` to `14`. The problem is that Node14 isn't supported for lambda functions using inline code (i.e `ZipFile`). Change to Node12 specifically for the notification handler since it's the only one using `InlineLambda`. Fixes aws#13620 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Please add your +1 👍 to let us know you have encountered this
Status: RESOLVED
Overview:
Users trying to configure s3 bucket notifications of any form will encounter a deployment failure.
This includes:
bucket.addEventNotification
S3EventSource
These resources use a custom resource that is shipped with the CDK. The root cause is a recent upgrade we performed switching from the
nodejs10.x
runtime tonodejs14.x
. CloudFormation does not support usingnodejs14.x
on lambda functions that use inline code (i.eZipFile
), which is indeed the case for this custom resource.aws-cdk/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts
Lines 78 to 82 in e8f6267
Complete Error Message:
ZipFile can only be used when Runtime is set to either of nodejs8.10, nodejs10.x, nodejs12.x, python2.7, python3.6, python3.7, python3.8
Workaround:
The workaround is to use escape hatches and modify the runtime property:
Solution:
Patch is available: https:/aws/aws-cdk/releases/tag/v1.94.1
Related Issues:
Originally reported as
Deploying our existing CDK stack fails with 1.94.0 ->
aws-cdk/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts
Line 85 in a5be042
Reproduction Steps
Try to deploy a stack that has a lambda that triggered from an S3 bucket event,
i.e.:
What did you expect to happen?
The stack do be deployed =)
What actually happened?
The mentioned error.
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: