From 8e68a1f7642fdb188f8764444ebd6d4ae91fe5c9 Mon Sep 17 00:00:00 2001 From: epolon Date: Thu, 14 Nov 2024 13:46:43 +0200 Subject: [PATCH 1/8] mid work --- packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts b/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts index 58bb2138ef9ba..a3470f6cd25c2 100644 --- a/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts +++ b/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts @@ -2,7 +2,7 @@ import { createCredentialChain, fromEnv, fromIni, fromNodeProviderChain } from ' import { MetadataService } from '@aws-sdk/ec2-metadata-service'; import type { NodeHttpHandlerOptions } from '@smithy/node-http-handler'; import { loadSharedConfigFiles } from '@smithy/shared-ini-file-loader'; -import { AwsCredentialIdentityProvider, Logger } from '@smithy/types'; +import { AwsCredentialIdentityProvider, Logger, ParsedIniData } from '@smithy/types'; import * as promptly from 'promptly'; import type { SdkHttpOptions } from './sdk-provider'; import { readIfPossible } from './util'; @@ -149,7 +149,12 @@ export class AwsCliCompatible { */ async function getRegionFromIni(profile: string): Promise { const sharedFiles = await loadSharedConfigFiles({ ignoreCache: true }); - return sharedFiles?.configFile?.[profile]?.region || sharedFiles?.configFile?.default?.region; + // https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html + return getRegionFromIniFile(profile, sharedFiles.configFile) ?? getRegionFromIniFile(profile, sharedFiles.credentialsFile); +} + +function getRegionFromIniFile(profile: string, data?: ParsedIniData) { + return data?.[profile]?.region ?? data?.default?.region; } function tryGetCACert(bundlePath?: string) { From 32116ba682adaae73fc34fbee534db4aedd29192 Mon Sep 17 00:00:00 2001 From: epolon Date: Thu, 14 Nov 2024 14:44:41 +0200 Subject: [PATCH 2/8] unit tests --- .../api/aws-auth/awscli-compatible.test.ts | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts diff --git a/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts new file mode 100644 index 0000000000000..c12dab8b8ad8d --- /dev/null +++ b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts @@ -0,0 +1,97 @@ +import * as os from 'os'; +import * as path from 'path'; +import * as fs from 'fs-extra'; +import { AwsCliCompatible } from '../../../lib/api/aws-auth/awscli-compatible'; + +describe('AwsCliCompatible.region', () => { + + test('default region can be specified in config', async () => { + + const config = ` + [default] + region=region-in-config + `; + + await expect(region({ configFile: config })).resolves.toBe('region-in-config'); + }); + + test('default region can be specified in credentials', async () => { + + const creds = ` + [default] + region=region-in-credentials + `; + + await expect(region({ credentialsFile: creds })).resolves.toBe('region-in-credentials'); + + }); + + test('profile region can be specified in config', async () => { + + const config = ` + [profile user1] + region=region-in-config + `; + + await expect(region({ configFile: config, profile: 'user1' })).resolves.toBe('region-in-config'); + + }); + + test('profile region can be specified in credentials', async () => { + + const creds = ` + [user1] + region=region-in-credentials + `; + + await expect(region({ credentialsFile: creds, profile: 'user1' })).resolves.toBe('region-in-credentials'); + + }); + + test('region from config takes precedence over region from credentials', async () => { + + const config = ` + [default] + region=region-in-config + `; + + const credentials = ` + [default] + region=region-in-credentials + `; + + await expect(region({ credentialsFile: credentials, configFile: config })).resolves.toBe('region-in-config'); + }); + +}); + +async function region(opts: { + readonly configFile?: string; + readonly credentialsFile?: string; + readonly profile?: string; +}) { + + const workdir = fs.mkdtempSync(path.join(os.tmpdir(), 'awscli-compatible.test')); + + try { + + if (opts.configFile) { + const configPath = path.join(workdir, 'config'); + fs.writeFileSync(configPath, opts.configFile); + process.env.AWS_CONFIG_FILE = configPath; + } + + if (opts.credentialsFile) { + const credentialsPath = path.join(workdir, 'credentials'); + fs.writeFileSync(credentialsPath, opts.credentialsFile); + process.env.AWS_SHARED_CREDENTIALS_FILE = credentialsPath; + } + + return await AwsCliCompatible.region(opts.profile); + + } finally { + process.env.AWS_CONFIG_FILE = '/dev/null'; + process.env.AWS_SHARED_CREDENTIALS_FILE = '/dev/null'; + fs.removeSync(workdir); + } +} \ No newline at end of file From ea4bf96633b3d86309a1c62eddbda63580fab205 Mon Sep 17 00:00:00 2001 From: epolon Date: Thu, 14 Nov 2024 15:24:38 +0200 Subject: [PATCH 3/8] mid work --- .../test/api/aws-auth/awscli-compatible.test.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts index c12dab8b8ad8d..bd6af618c3339 100644 --- a/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts +++ b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts @@ -5,6 +5,14 @@ import { AwsCliCompatible } from '../../../lib/api/aws-auth/awscli-compatible'; describe('AwsCliCompatible.region', () => { + beforeEach(() => { + + // make sure we don't mistakenly point to an unrelated file + process.env.AWS_CONFIG_FILE = '/dev/null'; + process.env.AWS_SHARED_CREDENTIALS_FILE = '/dev/null'; + + }); + test('default region can be specified in config', async () => { const config = ` @@ -55,12 +63,12 @@ describe('AwsCliCompatible.region', () => { region=region-in-config `; - const credentials = ` + const creds = ` [default] region=region-in-credentials `; - await expect(region({ credentialsFile: credentials, configFile: config })).resolves.toBe('region-in-config'); + await expect(region({ credentialsFile: creds, configFile: config })).resolves.toBe('region-in-config'); }); }); @@ -90,8 +98,6 @@ async function region(opts: { return await AwsCliCompatible.region(opts.profile); } finally { - process.env.AWS_CONFIG_FILE = '/dev/null'; - process.env.AWS_SHARED_CREDENTIALS_FILE = '/dev/null'; fs.removeSync(workdir); } } \ No newline at end of file From 125e822e392aa0e91a08a4350a8566a012a29b75 Mon Sep 17 00:00:00 2001 From: epolon Date: Thu, 14 Nov 2024 17:21:55 +0200 Subject: [PATCH 4/8] change priorities --- .../lib/api/aws-auth/awscli-compatible.ts | 21 ++- .../api/aws-auth/awscli-compatible.test.ts | 141 +++++++++++++++++- 2 files changed, 153 insertions(+), 9 deletions(-) diff --git a/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts b/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts index a3470f6cd25c2..78195f62d585c 100644 --- a/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts +++ b/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts @@ -2,7 +2,7 @@ import { createCredentialChain, fromEnv, fromIni, fromNodeProviderChain } from ' import { MetadataService } from '@aws-sdk/ec2-metadata-service'; import type { NodeHttpHandlerOptions } from '@smithy/node-http-handler'; import { loadSharedConfigFiles } from '@smithy/shared-ini-file-loader'; -import { AwsCredentialIdentityProvider, Logger, ParsedIniData } from '@smithy/types'; +import { AwsCredentialIdentityProvider, Logger } from '@smithy/types'; import * as promptly from 'promptly'; import type { SdkHttpOptions } from './sdk-provider'; import { readIfPossible } from './util'; @@ -149,12 +149,23 @@ export class AwsCliCompatible { */ async function getRegionFromIni(profile: string): Promise { const sharedFiles = await loadSharedConfigFiles({ ignoreCache: true }); - // https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html - return getRegionFromIniFile(profile, sharedFiles.configFile) ?? getRegionFromIniFile(profile, sharedFiles.credentialsFile); + + // Priority: + // + // 1. profile-region-in-credentials + // 2. profile-region-in-config + // 3. default-region-in-credentials + // 4. default-region-in-config + + return getRegionFromIniFile(profile, sharedFiles.credentialsFile) + ?? getRegionFromIniFile(profile, sharedFiles.configFile) + ?? getRegionFromIniFile('default', sharedFiles.credentialsFile) + ?? getRegionFromIniFile('default', sharedFiles.configFile); + } -function getRegionFromIniFile(profile: string, data?: ParsedIniData) { - return data?.[profile]?.region ?? data?.default?.region; +function getRegionFromIniFile(profile: string, data?: any) { + return data?.[profile]?.region; } function tryGetCACert(bundlePath?: string) { diff --git a/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts index bd6af618c3339..57561384fd598 100644 --- a/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts +++ b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts @@ -56,19 +56,152 @@ describe('AwsCliCompatible.region', () => { }); - test('region from config takes precedence over region from credentials', async () => { + test('with profile | profile-region-in-credentials is priority 1', async () => { const config = ` [default] - region=region-in-config + region=default-region-in-config + + [profile user] + region=profile-region-in-config + `; const creds = ` [default] - region=region-in-credentials + region=default-region-in-credentials + + [user] + region=profile-region-in-credentials + `; + + await expect(region({ credentialsFile: creds, configFile: config, profile: 'user' })).resolves.toBe('profile-region-in-credentials'); + }); + + test('with profile | profile-region-in-config is priority 2', async () => { + + const config = ` + [default] + region=default-region-in-config + + [profile user] + region=profile-region-in-config + + `; + + const creds = ` + [default] + region=default-region-in-credentials + + [user] + `; + + await expect(region({ credentialsFile: creds, configFile: config, profile: 'user' })).resolves.toBe('profile-region-in-config'); + }); + + test('with profile | default-region-in-credentials is priority 3', async () => { + + const config = ` + [default] + region=default-region-in-config + + [profile user] + + `; + + const creds = ` + [default] + region=default-region-in-credentials + + [user] + `; + + await expect(region({ credentialsFile: creds, configFile: config, profile: 'user' })).resolves.toBe('default-region-in-credentials'); + }); + + test('with profile | default-region-in-config is priority 4', async () => { + + const config = ` + [default] + region=default-region-in-config + + [profile user] + + `; + + const creds = ` + [default] + + [user] + `; + + await expect(region({ credentialsFile: creds, configFile: config, profile: 'user' })).resolves.toBe('default-region-in-config'); + }); + + test('with profile | us-east-1 is priority 5', async () => { + + const config = ` + [default] + + [profile user] + + `; + + const creds = ` + [default] + + [user] + `; + + await expect(region({ credentialsFile: creds, configFile: config, profile: 'user' })).resolves.toBe('us-east-1'); + }); + + test('without profile | default-region-in-credentials is priority 1', async () => { + + const config = ` + [default] + region=default-region-in-config + + `; + + const creds = ` + [default] + region=default-region-in-credentials + + `; + + await expect(region({ credentialsFile: creds, configFile: config })).resolves.toBe('default-region-in-credentials'); + }); + + test('without profile | default-region-in-config is priority 2', async () => { + + const config = ` + [default] + region=default-region-in-config + + `; + + const creds = ` + [default] + + `; + + await expect(region({ credentialsFile: creds, configFile: config })).resolves.toBe('default-region-in-config'); + }); + + test('without profile | us-east-1 is priority 3', async () => { + + const config = ` + [default] + + `; + + const creds = ` + [default] + `; - await expect(region({ credentialsFile: creds, configFile: config })).resolves.toBe('region-in-config'); + await expect(region({ credentialsFile: creds, configFile: config })).resolves.toBe('us-east-1'); }); }); From 4919bf8e7a7346d6c07c52ff73088e1095eaaff1 Mon Sep 17 00:00:00 2001 From: epolon Date: Thu, 14 Nov 2024 17:25:51 +0200 Subject: [PATCH 5/8] mid work --- packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts b/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts index 78195f62d585c..7db0423f5a6eb 100644 --- a/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts +++ b/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts @@ -152,6 +152,8 @@ async function getRegionFromIni(profile: string): Promise { // Priority: // + // credentials come before config because aws-cli v1 behaves like that. + // // 1. profile-region-in-credentials // 2. profile-region-in-config // 3. default-region-in-credentials From 673f5a34db3f849e8c3b9e70316e3f00320e2ec3 Mon Sep 17 00:00:00 2001 From: Otavio Macedo <288203+otaviomacedo@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:44:12 +0000 Subject: [PATCH 6/8] fix(cli): failure to get credentials when session token is not set (#32134) In Node.js, if you assign `undefined` to an environment variable, that variable ends up having the string `"undefined"`. If we are using IAM user credentials, `AWS_SESSION_TOKEN` should not be set, but because we were not handling this edge case, it was getting assigned an invalid value: ``` Welcome to Node.js v22.9.0. Type ".help" for more information. > process.env.AWS_SESSION_TOKEN || process.env.AMAZON_SESSION_TOKEN undefined > process.env.AWS_SESSION_TOKEN = process.env.AWS_SESSION_TOKEN || process.env.AMAZON_SESSION_TOKEN undefined > process.env.AWS_SESSION_TOKEN 'undefined' ``` Closes https://github.com/aws/aws-cdk/issues/32120. - [ ] 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* --- .../lib/api/aws-auth/awscli-compatible.ts | 7 ++- .../api/aws-auth/awscli-compatible.test.ts | 46 ++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts b/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts index 7db0423f5a6eb..be6462243031f 100644 --- a/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts +++ b/packages/aws-cdk/lib/api/aws-auth/awscli-compatible.ts @@ -200,11 +200,16 @@ function caBundlePathFromEnvironment(): string | undefined { function shouldPrioritizeEnv() { const id = process.env.AWS_ACCESS_KEY_ID || process.env.AMAZON_ACCESS_KEY_ID; const key = process.env.AWS_SECRET_ACCESS_KEY || process.env.AMAZON_SECRET_ACCESS_KEY; - process.env.AWS_SESSION_TOKEN = process.env.AWS_SESSION_TOKEN || process.env.AMAZON_SESSION_TOKEN; if (!!id && !!key) { process.env.AWS_ACCESS_KEY_ID = id; process.env.AWS_SECRET_ACCESS_KEY = key; + + const sessionToken = process.env.AWS_SESSION_TOKEN ?? process.env.AMAZON_SESSION_TOKEN; + if (sessionToken) { + process.env.AWS_SESSION_TOKEN = sessionToken; + } + return true; } diff --git a/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts index 57561384fd598..99b594688f723 100644 --- a/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts +++ b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts @@ -233,4 +233,48 @@ async function region(opts: { } finally { fs.removeSync(workdir); } -} \ No newline at end of file +} + +describe('Session token', () => { + beforeEach(() => { + process.env.AWS_ACCESS_KEY_ID = 'foo'; + process.env.AWS_SECRET_ACCESS_KEY = 'bar'; + }); + + test('does not mess up with session token env variables if they are undefined', async () => { + // Making sure these variables are not defined + delete process.env.AWS_SESSION_TOKEN; + delete process.env.AMAZON_SESSION_TOKEN; + + await AwsCliCompatible.credentialChainBuilder(); + + expect(process.env.AWS_SESSION_TOKEN).toBeUndefined(); + }); + + test('preserves AWS_SESSION_TOKEN if it is defined', async () => { + process.env.AWS_SESSION_TOKEN = 'aaa'; + delete process.env.AMAZON_SESSION_TOKEN; + + await AwsCliCompatible.credentialChainBuilder(); + + expect(process.env.AWS_SESSION_TOKEN).toEqual('aaa'); + }); + + test('assigns AWS_SESSION_TOKEN if it is not defined but AMAZON_SESSION_TOKEN is', async () => { + delete process.env.AWS_SESSION_TOKEN; + process.env.AMAZON_SESSION_TOKEN = 'aaa'; + + await AwsCliCompatible.credentialChainBuilder(); + + expect(process.env.AWS_SESSION_TOKEN).toEqual('aaa'); + }); + + test('preserves AWS_SESSION_TOKEN if both are defined', async () => { + process.env.AWS_SESSION_TOKEN = 'aaa'; + process.env.AMAZON_SESSION_TOKEN = 'bbb'; + + await AwsCliCompatible.credentialChainBuilder(); + + expect(process.env.AWS_SESSION_TOKEN).toEqual('aaa'); + }); +}); \ No newline at end of file From 44bc7b8bcf7f758b91c78a09a62364cfbd77b0d5 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 14 Nov 2024 16:14:13 +0000 Subject: [PATCH 7/8] fix(cdk): use built-in source map support (#32115) ### Reason for this change We don't need to use the third party `source-map-support` package anymore to achieve the same result. ### Description of changes We use `process.setSourceMapsEnabled(true)` instead. However unlike the previous package, this command needs to be run _before_ we import any other files, otherwise it won't work. We therefore move it into the executable. ### Description of how you validated changes Manual verification ### 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* --- .../cli-lib-alpha/THIRD_PARTY_LICENSES | 474 ------------------ packages/@aws-cdk/cli-lib-alpha/package.json | 1 + packages/aws-cdk/THIRD_PARTY_LICENSES | 63 --- packages/aws-cdk/bin/cdk | 5 + packages/aws-cdk/lib/cli.ts | 5 - packages/aws-cdk/package.json | 3 +- yarn.lock | 14 +- 7 files changed, 14 insertions(+), 551 deletions(-) diff --git a/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES b/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES index e31b9c6d28124..bdef416e7ed88 100644 --- a/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES +++ b/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES @@ -21816,211 +21816,6 @@ Apache License ---------------- -** @smithy/node-http-handler@3.2.4 - https://www.npmjs.com/package/@smithy/node-http-handler/v/3.2.4 | Apache-2.0 -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ----------------- - ** @smithy/node-http-handler@3.2.5 - https://www.npmjs.com/package/@smithy/node-http-handler/v/3.2.5 | Apache-2.0 Apache License Version 2.0, January 2004 @@ -22431,212 +22226,6 @@ Apache License ---------------- -** @smithy/protocol-http@4.1.4 - https://www.npmjs.com/package/@smithy/protocol-http/v/4.1.4 | Apache-2.0 - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - ----------------- - ** @smithy/protocol-http@4.1.5 - https://www.npmjs.com/package/@smithy/protocol-http/v/4.1.5 | Apache-2.0 Apache License Version 2.0, January 2004 @@ -28300,32 +27889,6 @@ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TOR ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------- - -** buffer-from@1.1.2 - https://www.npmjs.com/package/buffer-from/v/1.1.2 | MIT -MIT License - -Copyright (c) 2016, 2018 Linus Unnebäck - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - ---------------- ** camelcase@6.3.0 - https://www.npmjs.com/package/camelcase/v/6.3.0 | MIT @@ -30348,43 +29911,6 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------- - -** source-map-support@0.5.21 - https://www.npmjs.com/package/source-map-support/v/0.5.21 | MIT - ----------------- - -** source-map@0.6.1 - https://www.npmjs.com/package/source-map/v/0.6.1 | BSD-3-Clause - -Copyright (c) 2009-2011, Mozilla Foundation and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the names of the Mozilla Foundation nor the names of project - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ---------------- ** string_decoder@1.1.1 - https://www.npmjs.com/package/string_decoder/v/1.1.1 | MIT diff --git a/packages/@aws-cdk/cli-lib-alpha/package.json b/packages/@aws-cdk/cli-lib-alpha/package.json index f324871121491..49a48e313c633 100644 --- a/packages/@aws-cdk/cli-lib-alpha/package.json +++ b/packages/@aws-cdk/cli-lib-alpha/package.json @@ -87,6 +87,7 @@ "aws-cdk-lib": "0.0.0", "@aws-cdk/pkglint": "0.0.0", "@types/jest": "^29.5.14", + "@types/node": "^18.18.14", "aws-cdk": "0.0.0", "constructs": "^10.0.0", "jest": "^29.7.0", diff --git a/packages/aws-cdk/THIRD_PARTY_LICENSES b/packages/aws-cdk/THIRD_PARTY_LICENSES index ed01726f1acb7..b4da7ccc205a4 100644 --- a/packages/aws-cdk/THIRD_PARTY_LICENSES +++ b/packages/aws-cdk/THIRD_PARTY_LICENSES @@ -27682,32 +27682,6 @@ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TOR ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------- - -** buffer-from@1.1.2 - https://www.npmjs.com/package/buffer-from/v/1.1.2 | MIT -MIT License - -Copyright (c) 2016, 2018 Linus Unnebäck - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - ---------------- ** camelcase@6.3.0 - https://www.npmjs.com/package/camelcase/v/6.3.0 | MIT @@ -29730,43 +29704,6 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------- - -** source-map-support@0.5.21 - https://www.npmjs.com/package/source-map-support/v/0.5.21 | MIT - ----------------- - -** source-map@0.6.1 - https://www.npmjs.com/package/source-map/v/0.6.1 | BSD-3-Clause - -Copyright (c) 2009-2011, Mozilla Foundation and contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the names of the Mozilla Foundation nor the names of project - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ---------------- ** string_decoder@1.1.1 - https://www.npmjs.com/package/string_decoder/v/1.1.1 | MIT diff --git a/packages/aws-cdk/bin/cdk b/packages/aws-cdk/bin/cdk index 280814a578a49..46528824d34a8 100755 --- a/packages/aws-cdk/bin/cdk +++ b/packages/aws-cdk/bin/cdk @@ -1,2 +1,7 @@ #!/usr/bin/env node + +// source maps must be enabled before importing files +if (process.argv.includes('--debug')) { + process.setSourceMapsEnabled(true); +} require('./cdk.js'); diff --git a/packages/aws-cdk/lib/cli.ts b/packages/aws-cdk/lib/cli.ts index fec8f492b9d2a..567dfd6201ab9 100644 --- a/packages/aws-cdk/lib/cli.ts +++ b/packages/aws-cdk/lib/cli.ts @@ -1,7 +1,6 @@ import * as cxapi from '@aws-cdk/cx-api'; import '@jsii/check-node/run'; import * as chalk from 'chalk'; -import { install as enableSourceMapSupport } from 'source-map-support'; import { DeploymentMethod } from './api'; import { HotswapMode } from './api/hotswap/common'; @@ -53,10 +52,6 @@ export async function exec(args: string[], synthesizer?: Synthesizer): Promise 2) { enableTracing(true); diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index 4cad33d3794d2..c88cccd69e81d 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -76,11 +76,11 @@ "@types/fs-extra": "^9.0.13", "@types/glob": "^7.2.0", "@types/jest": "^29.5.12", + "@types/node": "^18.18.14", "@types/mockery": "^1.4.33", "@types/promptly": "^3.0.5", "@types/semver": "^7.5.8", "@types/sinon": "^9.0.11", - "@types/source-map-support": "^0.5.10", "@types/table": "^6.3.2", "@types/uuid": "^8.3.4", "@types/wrap-ansi": "^3.0.0", @@ -149,7 +149,6 @@ "promptly": "^3.2.0", "proxy-agent": "^6.4.0", "semver": "^7.6.3", - "source-map-support": "^0.5.21", "strip-ansi": "^6.0.1", "table": "^6.8.2", "uuid": "^8.3.2", diff --git a/yarn.lock b/yarn.lock index 8431c77e679e3..dbd1ef6322cc9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6315,6 +6315,13 @@ dependencies: undici-types "~5.26.4" +"@types/node@^18.18.14": + version "18.19.64" + resolved "https://registry.npmjs.org/@types/node/-/node-18.19.64.tgz#122897fb79f2a9ec9c979bded01c11461b2b1478" + integrity sha512-955mDqvO2vFf/oL7V3WiUtiz+BugyX8uVbaT2H8oj3+8dRyH2FLiNdowe7eNqRM7IOIZvzDH76EoAT+gwm6aIQ== + dependencies: + undici-types "~5.26.4" + "@types/normalize-package-data@^2.4.0": version "2.4.4" resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" @@ -6385,13 +6392,6 @@ resolved "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz#5fd3592ff10c1e9695d377020c033116cc2889f2" integrity sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ== -"@types/source-map-support@^0.5.10": - version "0.5.10" - resolved "https://registry.npmjs.org/@types/source-map-support/-/source-map-support-0.5.10.tgz#824dcef989496bae98e9d04c8dc1ac1d70e1bd39" - integrity sha512-tgVP2H469x9zq34Z0m/fgPewGhg/MLClalNOiPIzQlXrSS2YrKu/xCdSCKnEDwkFha51VKEKB6A9wW26/ZNwzA== - dependencies: - source-map "^0.6.0" - "@types/stack-utils@^2.0.0": version "2.0.3" resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" From aa9fb793959b909ae99a642240eb2d6e0d748bea Mon Sep 17 00:00:00 2001 From: epolon Date: Thu, 14 Nov 2024 19:34:46 +0200 Subject: [PATCH 8/8] fix tests --- .../aws-cdk/test/api/aws-auth/awscli-compatible.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts index 850fc9ac7a550..c8d7ccb886012 100644 --- a/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts +++ b/packages/aws-cdk/test/api/aws-auth/awscli-compatible.test.ts @@ -11,6 +11,13 @@ describe('AwsCliCompatible.region', () => { process.env.AWS_CONFIG_FILE = '/dev/null'; process.env.AWS_SHARED_CREDENTIALS_FILE = '/dev/null'; + // these take precedence over the ini files so we need to disable them for + // the test to invoke the right function + delete process.env.AWS_REGION; + delete process.env.AMAZON_REGION; + delete process.env.AWS_DEFAULT_REGION; + delete process.env.AMAZON_DEFAULT_REGION; + }); test('default region can be specified in config', async () => {