-
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
fix: CDK does not honor NO_PROXY settings #16751
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this change is causing EKS deployments to fail. CloudFormation now throws
Internal Failure.
when trying to create.This handler is used in the "onComplete" Lambda function which does not have the
proxy-agent
available. We only pass anhttp_proxy
env var into the "onEvent" Lambda since that is the only Lambda that makes requests with theaws-sdk-js
.I tested this by moving the proxy logic to the
onEvent()
method and was able to successfully deploy again. I'll make a PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also noticed that
new ProxyAgent()
does not automatically detectprocess.env.http_proxy
orprocess.env.HTTP_PROXY
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's what ProxyAgent looks like when you log it in the Lambda:
Code:
Logs:
Code:
Logs:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested using https://github.com/ryparker/aws-cdk-sample-eks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's normal and expected that the
ProxyAgent
instance does not look the same. If provided with a proxy, it will use ALWAYS and ONLY that proxy. When not specified, it will delegate toproxy-from-env
, which will look at the correct proxy environment variable for the request' protocol & honor NO_PROXY.I'd argue that the broken Lambda function should receive an
HTTPS_PROXY
and notHTTP_PROXY
, as the AWS SDK typically makes only TSL connections... So it should be expected NOT to useHTTP_PROXY
(using that value is incorrect there and should be considered a bug).