Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/aws-cdk/lib/api/aws-auth/sdk-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import { Mode } from '../aws-auth/credentials';
import { AwsCliCompatible } from './awscli-compatible';
import { ISDK, SDK } from './sdk';


// Some configuration that can only be achieved by setting
// environment variables.
process.env.AWS_STS_REGIONAL_ENDPOINTS = 'regional';
process.env.AWS_NODEJS_CONNECTION_REUSE_ENABLED = '1';

/**
* Options for the default SDK provider
*/
Expand Down Expand Up @@ -82,7 +88,7 @@ const CACHED_DEFAULT_CREDENTIALS = Symbol('cached_default_credentials');
*/
export class SdkProvider {
/**
* Create a new SdkProvider which gets its defaults in a way that haves like the AWS CLI does
* Create a new SdkProvider which gets its defaults in a way that behaves like the AWS CLI does
*
* The AWS SDK for JS behaves slightly differently from the AWS CLI in a number of ways; see the
* class `AwsCliCompatible` for the details.
Expand Down Expand Up @@ -302,6 +308,7 @@ function parseHttpOptions(options: SdkHttpOptions) {
debug('Using CA bundle path: %s', caBundlePath);
config.httpOptions.agent = new https.Agent({
ca: readIfPossible(caBundlePath),
keepAlive: true,
});
}

Expand Down
2 changes: 2 additions & 0 deletions packages/cdk-assets/bin/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class DefaultAwsClient implements IAws {
constructor(profile?: string) {
// Force AWS SDK to look in ~/.aws/credentials and potentially use the configured profile.
process.env.AWS_SDK_LOAD_CONFIG = '1';
process.env.AWS_STS_REGIONAL_ENDPOINTS = 'regional';
process.env.AWS_NODEJS_CONNECTION_REUSE_ENABLED = '1';
if (profile) {
process.env.AWS_PROFILE = profile;
}
Expand Down