-
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
'cdk deploy' fails when using 'cdk bootstrap' while being behind a corporate proxy #1736
Comments
Update: I managed to adapt the solution for the "plain" JavaScript SDK (=> aws/aws-sdk-js#1619 (comment)) in my enterprise environment. I can successfully use the following proxy agent with the SDK + CNTLM:
In order to confirm that the CDK deployment works with this agent, I put that piece of code into my local file So the big question is: what would be a nice way to get that into the CDK in a flexible and configurable way? |
Hi, this does not solve the issue. Specifying a proxy via args definitely works with the current version and last versions of the CDK. Please re-open this issue. |
@eladb @sam-goodwin just confirmed again that this issue still exists with 0.28.0. Please re-open it. |
Hi,
I am using the CDK (currently 0.24.1) behind a corporate proxy. It is a squid proxy using NTLMv2; on the machine on which I am running the CDK, the proxy connection is established via CNTLM. So the application has to connect to localhost:3128
Until now, most of it worked nicely and all
cdk diff
andcdk deploy
commands worked through the proxy. Today I hit the 50kb mark with the CF template of one of the CDK apps I'm deploying. Therefore, I started to usecdk bootstrap
, which I didn't before. The CDKToolkit stack got setup without a problem and the staging S3 bucket exists.Unfortunately, now I'm getting the following error on my machine when trying to use the same
cdk deploy
as before:When specifying the CNTLM proxy on my machine explicitly in
cdk deploy ... --proxy http://localhost:3128
I get:I strongly assume, that this problem is related to the following issue in aws-sdk-js: aws/aws-sdk-js#1619 (comment)
Regarding the 407: I verified that the proxy is generally working on the machine by successfully curling s3.amazonaws.com - the 407 seems to be a common error when trying to use the JavaScript AWS SDK with CONNECT proxies.
The fact, that in my case the CDKToolkit bucket exists but is empty looks like the error happens during the upload of the CF template to the bucket. This is consistent with another experience I had with the CDK when the upload of a Lambda function to S3 failed.
The solution mentioned in the linked answer, cannot be used here as the user cannot change the proxy agent library in the CDK as the used agent implementation cannot be configured, if I understand this part of the code correctly: https://github.com/awslabs/aws-cdk/blob/54789139611bdae1e9d59e88c6355c45d7ceffe2/packages/aws-cdk/lib/api/util/sdk.ts#L71
Does someone have any suggestion for me on how to resolve this? Should the user be able to pass a custom proxy agent to the CDK or are there any other possible solutions to be considered here?
It would be great to find a solution for this, as those parts of the enterprise world that are running on Amazon get more and more interested in the CDK. Therefore, it would be great for it to run as well behind a corporate proxy as the AWS CLI does.
The text was updated successfully, but these errors were encountered: