-
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
(AwsCustomResource): fails to use latest SDK version #29891
(AwsCustomResource): fails to use latest SDK version #29891
Comments
@frfavoreto , thanks for reaching out. Team is already Tracking this and working on it. |
I'm also running into this, but in my case, the custom resource never succeeds. |
Please note that this is currently causing deployments to fail for custom resources that that use |
@frfavoreto @jakekarnes42 What version of the CDK are you using and do you know what version you started encountering this in? |
@colifran Today I upgraded from CDK 2.131.0 to 2.138.0 (the current latest version) and that's when the issue began. Previously successful deployments began to fail. Investigating the failures came to exact conclusion shared by @frfavoreto in the original issue description. Each deployment contains about 15 custom resources which would fail intermittently. Upon reviewing the Lambda logs, it appears that sometimes the Lambda would succeed after falling back to the default SDK. Infrequently, it would timeout before successfully falling back. That could cause the Custom Resource update to fail, and cascade the failure to the rest of the deployment. Since I'm deploying multiple custom resources, I found that at least one would fail on each deployment attempt. I rolled back to CDK 2.131.0 and the issue is no longer present. I'm back to successful deployments. This appears to be regression sometime between those two versions. I hope this helps and thanks for the quick support! |
@jakekarnes42 Thanks for the clarification. What is strange is that I have also gone back to 2.131.0, but I'm still getting the time out when trying to install the latest SDK version. I've looked through some of our recent changes and I'm not seeing anything that would make me think this is something on the CDK side. I'm wondering if this could be an SDK related issue? We will continue to investigate / monitor! |
@frfavoreto @jakekarnes42 I did some more testing and it appears that the 2 minute default timeout that is set for |
@colifran When I increase It happens to any aws-cdk-lib version that provision functions with Nodejs18.x. |
I can confirm that increasing the timeout fixed this issue for me, too. |
This should be way more visible that it is tbh - it causes all my custom resources to fail, increasing the timeout is an option but very costly time wise. Since this is not fixed yest i just set the |
The source code where timeout happens after 120 seconds. Lines 25 to 29 in 6fdc458
|
The installation of the sdk is a direct call to npm so we have no control over the latency here. If npm is experiencing increased latency in their downloads, we can only mitigate that by providing a version of the sdk that we know is safe to use. I did also do a quick check to see if the asset size for the sdk significantly increased recently and it looks like it has not. There is definitely room to improve the documentation here to specify WHY you might want to increase this timeout, but there is no fix here because there is not actually a bug (on our end, there may be an issue with npm, the sdk, or somewhere else). If increasing the timeout is too costly, then changing this setting to false is the right way to go. |
I'm going to suspect there's something going on with the SDK and/or npm here. On https://www.npmjs.com/package/@aws-sdk/client-s3 it says the most recent version is from 9 days ago and lists 3.556.0 as the most up-to-date version. On https://github.com/aws/aws-sdk-js-v3 latest is 3.562.0 published 12 hours ago. |
This is a global version of the AWS SDK for JavaScript. We only publish the modules which are updated in a version, but keep the version number same for easy comparison. During dev-preview, we'd followed independent versioning which had caused confusion among users. Users also complained about fixed versioning for all modules, where new version doesn't have any update. Fixed versioning only when required was a good middle path.
This is correct. There hasn't be any update in |
### Issue # (if applicable) Closes #29891 ### Reason for this change When setting AwsCustomResource with installLatestAwsSdk: true it fails to upgrade aws-sdk to latest version. The Lambda function created to support the custom resource usually time out after 120 seconds, and for some cases it get time out even after 900 seconds. ### Description of changes Update the Lambda function created for the custom resource to set its MemorySize to be 512 in case if installLatestAwsSdk flag is true instead of the default value 128. Also, this change will expose the MemorySize to the AwsCustomResource construct, so customers can customize the MemorySize of the Lambda function to fulfill use cases that requires higher memory, CPU, or I/O performance. ### Description of how you validated changes I added the unit test cases, and updated the integration test cases. ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
When setting
AwsCustomResource
withinstallLatestAwsSdk: true
it fails to upgrade aws-sdk to latest version (at this momentv3.556.0
) and fails back to the default (currentlyv3.515.0
in Lambda).Examples with DynamoDB:
and SSM modules:
The custom resource eventually succeeds, after failing back to the default aws-sdk.
Expected Behavior
Be able to update the Lambda Nodejs18 runtime with the latest SDKv3 version.
Current Behavior
Unable to retrieve and upgrade Lambda Nodejs18 for SDKv3 latest version
Reproduction Steps
Deploy a CDK App with a Custom Resource that has
installLatestAwsSdk: true
:Check the underlying Lambda Function's logs to see the messages above.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.137.0
Framework Version
No response
Node.js Version
18
OS
Mac
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: