Skip to content

Commit

Permalink
fix(cli): HTTP timeout is too low for some asset uploads (#13575)
Browse files Browse the repository at this point in the history
Close #13183 

I checked the code base and I understacd that the setting parameter when construct `SdkProvider` in cdk.ts is used when construct actual sdk instance.

If there are no problems with my implementation, I would like to write a test and complete the PR. 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
hedrall committed Jun 14, 2021
1 parent 0189a9a commit 23c58d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/aws-cdk/lib/api/aws-auth/sdk-provider.ts
Expand Up @@ -348,6 +348,9 @@ export interface Account {
readonly partition: string;
}

const DEFAULT_CONNECTION_TIMEOUT = 10000;
const DEFAULT_TIMEOUT = 300000;

/**
* Get HTTP options for the SDK
*
Expand All @@ -360,6 +363,9 @@ function parseHttpOptions(options: SdkHttpOptions) {
const config: ConfigurationOptions = {};
config.httpOptions = {};

config.httpOptions.connectTimeout = DEFAULT_CONNECTION_TIMEOUT;
config.httpOptions.timeout = DEFAULT_TIMEOUT;

let userAgent = options.userAgent;
if (userAgent == null) {
// Find the package.json from the main toolkit
Expand Down

0 comments on commit 23c58d6

Please sign in to comment.