Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
57e94ff
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 16, 2025
d8bc4a3
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 16, 2025
1eb4a28
refactor(codecatalyst): migrate to aws-sdk v3 (#8043)
ctlai95 Sep 16, 2025
6fe1b48
refactor(apigateway): migrate to aws sdk v3 (#8042)
ctlai95 Sep 16, 2025
b3a96a9
refactor(accessanalyzer): migrate to aws sdk v3 (#8046)
ctlai95 Sep 16, 2025
977bef7
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 17, 2025
d5b55f7
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 17, 2025
e28440b
refactor(iot): migrate to aws-sdk v3 (#8054)
ctlai95 Sep 18, 2025
01da25f
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 18, 2025
d14e68c
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 19, 2025
665d5a8
refactor(lambda): migrate to aws-sdk v3 (#8041)
ctlai95 Sep 19, 2025
00abff1
refactor(schemas): migrate to aws-sdk v3 (#8056)
ctlai95 Sep 19, 2025
835cdb1
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 19, 2025
d74786f
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 23, 2025
35976ce
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 24, 2025
dc49b64
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 24, 2025
43eec2b
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 24, 2025
17221e1
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 25, 2025
64adf3e
refactor(iot): migrate to aws-sdk v3 part 2 (#8081)
ctlai95 Sep 25, 2025
ac44c5e
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 25, 2025
19e8e1c
refactor(redshift): migrate to aws-sdk v3 (#8069)
ctlai95 Sep 25, 2025
086ba97
refactor(ssm): migrate to aws-sdk v3 (#8067)
ctlai95 Sep 26, 2025
6d81ae2
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 26, 2025
151292b
refactor(schemas): migrate to aws-sdk v3 part 2 (#8093)
ctlai95 Sep 26, 2025
704ca6f
refactor(secretsmanager): migrate to aws sdk v3 (#8095)
ctlai95 Sep 26, 2025
2e4d58b
refactor(ecs): migrate to aws sdk v3 (#8094)
ctlai95 Sep 26, 2025
c0dcda4
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 26, 2025
c9d3574
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 29, 2025
285156e
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Sep 29, 2025
f8d0262
chore(amazonq): merge master into feature branch
chungjac Oct 8, 2025
bacfc94
fix(core): flaky lambda test
chungjac Oct 8, 2025
a86637e
Update invokeLambda.test.ts to use nodejs24.x
chungjac Oct 8, 2025
6625a9e
Update invokeLambda.test.ts
chungjac Oct 8, 2025
7e72040
Merge pull request #8154 from chungjac/feature/v2-to-v3-migration
chungjac Oct 8, 2025
185406d
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 9, 2025
2b3610e
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 9, 2025
af36b95
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 9, 2025
df3eace
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 10, 2025
88cc44a
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 11, 2025
b685471
refactor(awserror): migrate AWSError to ServiceException part 1 (#8171)
chungjac Oct 13, 2025
f62914e
refactor(core): migrate various clients from aws-sdk v2 to v3 (#8159)
chungjac Oct 13, 2025
999eaa9
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 13, 2025
54a0aa0
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 14, 2025
b5978a7
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 14, 2025
3177528
refactor(core): migrate various clients from aws-sdk v2 to v3 pt2 (#8…
chungjac Oct 15, 2025
d4e422b
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 15, 2025
59fd17f
test(core): unskip flaky test (#8182)
chungjac Oct 15, 2025
8befbb1
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 15, 2025
2d466c2
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 16, 2025
765df56
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 17, 2025
ef15940
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 17, 2025
4063499
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 18, 2025
7d8faf3
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 20, 2025
635e897
Merge master into feature/v2-to-v3-migration
aws-toolkit-automation Oct 21, 2025
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
13,004 changes: 8,893 additions & 4,111 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
codeWhispererClient,
} from 'aws-core-vscode/codewhisperer'
import { globals, getClientId, getOperatingSystem } from 'aws-core-vscode/shared'
import { AWSError, Request } from 'aws-sdk'
import { Request } from 'aws-sdk'
import { ServiceException } from '@smithy/smithy-client'
import { createSpyClient } from 'aws-core-vscode/test'

describe('codewhisperer', async function () {
Expand Down Expand Up @@ -109,7 +110,7 @@ describe('codewhisperer', async function () {
requestId: '',
},
}),
} as Request<SendTelemetryEventResponse, AWSError>)
} as Request<SendTelemetryEventResponse, ServiceException>)

const expectedUserContext = {
ideCategory: 'VSCODE',
Expand All @@ -134,7 +135,7 @@ describe('codewhisperer', async function () {
requestId: '',
},
}),
} as Request<SendTelemetryEventResponse, AWSError>)
} as Request<SendTelemetryEventResponse, ServiceException>)

const authUtilStub = sinon.stub(AuthUtil.instance, 'isValidEnterpriseSsoInUse').returns(isSso)
await globals.telemetry.setTelemetryEnabled(isTelemetryEnabled)
Expand Down
27 changes: 19 additions & 8 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,13 @@
"@types/sinon": "^10.0.5",
"@types/sinonjs__fake-timers": "^8.1.2",
"@types/stream-buffers": "^3.0.7",
"@types/svgdom": "^0.1.2",
"@types/tcp-port-used": "^1.0.1",
"@types/uuid": "^9.0.1",
"@types/whatwg-url": "^11.0.4",
"@types/xml2js": "^0.4.11",
"@types/svgdom": "^0.1.2",
"@vue/compiler-sfc": "^3.3.2",
"aws-sdk-client-mock": "^4.1.0",
"c8": "^9.0.0",
"circular-dependency-plugin": "^5.2.2",
"css-loader": "^6.10.0",
Expand Down Expand Up @@ -580,7 +581,7 @@
"@amzn/amazon-q-developer-streaming-client": "file:../../src.gen/@amzn/amazon-q-developer-streaming-client",
"@amzn/codewhisperer-streaming": "file:../../src.gen/@amzn/codewhisperer-streaming",
"@amzn/sagemaker-client": "file:../../src.gen/@amzn/sagemaker-client/1.0.0.tgz",
"@aws-sdk/credential-providers": "<3.731.0",
"@aws-sdk/client-accessanalyzer": "^3.888.0",
"@aws-sdk/client-api-gateway": "<3.731.0",
"@aws-sdk/client-apprunner": "<3.731.0",
"@aws-sdk/client-cloudcontrol": "<3.731.0",
Expand All @@ -592,19 +593,29 @@
"@aws-sdk/client-docdb": "<3.731.0",
"@aws-sdk/client-docdb-elastic": "<3.731.0",
"@aws-sdk/client-ec2": "<3.731.0",
"@aws-sdk/client-ecr": "~3.693.0",
"@aws-sdk/client-ecs": "~3.693.0",
"@aws-sdk/client-glue": "^3.852.0",
"@aws-sdk/client-iam": "<3.731.0",
"@aws-sdk/client-iot": "~3.693.0",
"@aws-sdk/client-iotsecuretunneling": "~3.693.0",
"@aws-sdk/client-lambda": "<3.731.0",
"@aws-sdk/client-redshift": "~3.693.0",
"@aws-sdk/client-redshift-data": "~3.693.0",
"@aws-sdk/client-redshift-serverless": "~3.693.0",
"@aws-sdk/client-s3": "<3.731.0",
"@aws-sdk/client-s3-control": "^3.830.0",
"@aws-sdk/client-sagemaker": "<3.696.0",
"@aws-sdk/client-schemas": "~3.693.0",
"@aws-sdk/client-secrets-manager": "~3.693.0",
"@aws-sdk/client-sfn": "<3.731.0",
"@aws-sdk/client-ssm": "<3.731.0",
"@aws-sdk/client-sso": "<3.731.0",
"@aws-sdk/client-sso-oidc": "<3.731.0",
"@aws-sdk/client-sfn": "<3.731.0",
"@aws-sdk/credential-provider-env": "<3.731.0",
"@aws-sdk/credential-provider-process": "<3.731.0",
"@aws-sdk/credential-provider-sso": "<3.731.0",
"@aws-sdk/credential-providers": "<3.731.0",
"@aws-sdk/lib-storage": "<3.731.0",
"@aws-sdk/property-provider": "<3.731.0",
"@aws-sdk/protocol-http": "<3.731.0",
Expand All @@ -621,6 +632,7 @@
"@smithy/service-error-classification": "^4.0.1",
"@smithy/shared-ini-file-loader": "^4.0.0",
"@smithy/util-retry": "^4.0.1",
"@svgdotjs/svg.js": "^3.0.16",
"@vscode/debugprotocol": "^1.57.0",
"@zip.js/zip.js": "^2.7.41",
"adm-zip": "^0.5.10",
Expand All @@ -639,6 +651,7 @@
"http2": "^3.3.6",
"i18n-ts": "^1.0.5",
"immutable": "^4.3.0",
"jaro-winkler": "^0.2.8",
"jose": "5.4.1",
"js-yaml": "^4.1.0",
"jsonc-parser": "^3.2.0",
Expand All @@ -648,9 +661,11 @@
"mime-types": "^2.1.32",
"node-fetch": "^2.7.0",
"portfinder": "^1.0.32",
"protobufjs": "^7.2.6",
"semver": "^7.5.4",
"stream-buffers": "^3.0.2",
"strip-ansi": "^5.2.0",
"svgdom": "^0.1.0",
"tcp-port-used": "^1.0.1",
"vscode-languageclient": "^6.1.4",
"vscode-languageserver": "^6.1.1",
Expand All @@ -663,11 +678,7 @@
"winston-transport": "^4.6.0",
"ws": "^8.16.0",
"xml2js": "^0.6.1",
"yaml-cfn": "^0.3.2",
"protobufjs": "^7.2.6",
"@svgdotjs/svg.js": "^3.0.16",
"svgdom": "^0.1.0",
"jaro-winkler": "^0.2.8"
"yaml-cfn": "^0.3.2"
},
"overrides": {
"webfont": {
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/awsService/accessanalyzer/vue/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export type PolicyChecksCheckType = 'CheckNoNewAccess' | 'CheckAccessNotGranted'

export type PolicyChecksPolicyType = 'Identity' | 'Resource'

export type ValidatePolicyFindingType = 'ERROR' | 'SECURITY_WARNING' | 'SUGGESTION' | 'WARNING'

export type PolicyChecksResult = 'Success' | 'Warning' | 'Error'

export type PolicyChecksUiClick =
Expand Down
161 changes: 85 additions & 76 deletions packages/core/src/awsService/accessanalyzer/vue/iamPolicyChecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { localize } from '../../../shared/utilities/vsCodeUtils'
import { VueWebview, VueWebviewPanel } from '../../../webviews/main'
import { ExtContext } from '../../../shared/extensions'
import { telemetry } from '../../../shared/telemetry/telemetry'
import { AccessAnalyzer, SharedIniFileCredentials } from 'aws-sdk'
import { AccessAnalyzerClient, ValidatePolicyCommand } from '@aws-sdk/client-accessanalyzer'
import { fromIni } from '@aws-sdk/credential-providers'
import { ToolkitError } from '../../../shared/errors'
import { makeTemporaryToolkitFolder, tryRemoveFolder } from '../../../shared/filesystemUtilities'
import globals from '../../../shared/extensionGlobals'
Expand All @@ -23,7 +24,6 @@ import {
PolicyChecksPolicyType,
PolicyChecksResult,
PolicyChecksUiClick,
ValidatePolicyFindingType,
} from './constants'
import { S3Client, parseS3Uri } from '../../../shared/clients/s3'
import { ExpiredTokenException } from '@aws-sdk/client-sso-oidc'
Expand Down Expand Up @@ -61,7 +61,7 @@ export class IamPolicyChecksWebview extends VueWebview {

public constructor(
private readonly data: IamPolicyChecksInitialData,
private client: AccessAnalyzer,
private client: AccessAnalyzerClient,
private readonly region: string,
public readonly onChangeInputPath = new vscode.EventEmitter<string>(),
public readonly onChangeCheckNoNewAccessFilePath = new vscode.EventEmitter<string>(),
Expand Down Expand Up @@ -179,85 +179,94 @@ export class IamPolicyChecksWebview extends VueWebview {
documentType,
inputPolicyType: policyType ? policyType : 'None',
})
this.client.config.credentials = new SharedIniFileCredentials({
this.client.config.credentials = fromIni({
profile: `${getProfileName()}`,
}) // We need to detect changes in the user's credentials
this.client.validatePolicy(
{
policyDocument: IamPolicyChecksWebview.editedDocument,
policyType: policyType === 'Identity' ? 'IDENTITY_POLICY' : 'RESOURCE_POLICY',
},
(err, data) => {
if (err) {
this.client
.send(
new ValidatePolicyCommand({
policyDocument: IamPolicyChecksWebview.editedDocument,
policyType: policyType === 'Identity' ? 'IDENTITY_POLICY' : 'RESOURCE_POLICY',
})
)
.then((data) => {
if (data.findings && data.findings.length > 0) {
span.record({
findingsCount: 0,
findingsCount: data.findings.length,
})
if (err instanceof ExpiredTokenException) {
this.onValidatePolicyResponse.fire([
IamPolicyChecksConstants.InvalidAwsCredentials,
getResultCssColor('Error'),
])
} else {
this.onValidatePolicyResponse.fire([err.message, getResultCssColor('Error')])
}
} else {
if (data.findings.length > 0) {
span.record({
findingsCount: data.findings.length,
})
// eslint-disable-next-line unicorn/no-array-for-each
data.findings.forEach((finding: AccessAnalyzer.ValidatePolicyFinding) => {
const message = `${finding.findingType}: ${finding.issueCode} - ${finding.findingDetails} Learn more: ${finding.learnMoreLink}`
if ((finding.findingType as ValidatePolicyFindingType) === 'ERROR') {
diagnostics.push(
new vscode.Diagnostic(
new vscode.Range(
finding.locations[0].span.start.line,
finding.locations[0].span.start.offset,
finding.locations[0].span.end.line,
finding.locations[0].span.end.offset
),
message,
vscode.DiagnosticSeverity.Error
)
)
validatePolicyDiagnosticCollection.set(
IamPolicyChecksWebview.editedDocumentUri,
diagnostics
// eslint-disable-next-line unicorn/no-array-for-each
data.findings.forEach((finding) => {
const locationSpan = finding.locations?.[0].span
if (
!locationSpan?.start?.line ||
!locationSpan.start.offset ||
!locationSpan.end?.line ||
!locationSpan.end.offset
) {
return
}
const message = `${finding.findingType}: ${finding.issueCode} - ${finding.findingDetails} Learn more: ${finding.learnMoreLink}`
if (finding.findingType === 'ERROR') {
diagnostics.push(
new vscode.Diagnostic(
new vscode.Range(
locationSpan.start.line,
locationSpan.start.offset,
locationSpan.end.line,
locationSpan.end.offset
),
message,
vscode.DiagnosticSeverity.Error
)
} else {
diagnostics.push(
new vscode.Diagnostic(
new vscode.Range(
finding.locations[0].span.start.line,
finding.locations[0].span.start.offset,
finding.locations[0].span.end.line,
finding.locations[0].span.end.offset
),
message,
vscode.DiagnosticSeverity.Warning
)
)
validatePolicyDiagnosticCollection.set(
IamPolicyChecksWebview.editedDocumentUri,
diagnostics
)
} else {
diagnostics.push(
new vscode.Diagnostic(
new vscode.Range(
locationSpan.start.line,
locationSpan.start.offset,
locationSpan.end.line,
locationSpan.end.offset
),
message,
vscode.DiagnosticSeverity.Warning
)
validatePolicyDiagnosticCollection.set(
IamPolicyChecksWebview.editedDocumentUri,
diagnostics
)
}
})
this.onValidatePolicyResponse.fire([
IamPolicyChecksConstants.ValidatePolicySuccessWithFindings,
getResultCssColor('Warning'),
])
void vscode.commands.executeCommand('workbench.actions.view.problems')
} else {
this.onValidatePolicyResponse.fire([
IamPolicyChecksConstants.ValidatePolicySuccessNoFindings,
getResultCssColor('Success'),
])
}
)
validatePolicyDiagnosticCollection.set(
IamPolicyChecksWebview.editedDocumentUri,
diagnostics
)
}
})
this.onValidatePolicyResponse.fire([
IamPolicyChecksConstants.ValidatePolicySuccessWithFindings,
getResultCssColor('Warning'),
])
void vscode.commands.executeCommand('workbench.actions.view.problems')
} else {
this.onValidatePolicyResponse.fire([
IamPolicyChecksConstants.ValidatePolicySuccessNoFindings,
getResultCssColor('Success'),
])
}
})
.catch((err) => {
span.record({
findingsCount: 0,
})
if (err instanceof ExpiredTokenException) {
this.onValidatePolicyResponse.fire([
IamPolicyChecksConstants.InvalidAwsCredentials,
getResultCssColor('Error'),
])
} else {
this.onValidatePolicyResponse.fire([err.message, getResultCssColor('Error')])
}
}
)
})
})
return
} else {
Expand Down Expand Up @@ -781,7 +790,7 @@ const Panel = VueWebview.compilePanel(IamPolicyChecksWebview)
export async function renderIamPolicyChecks(context: ExtContext): Promise<VueWebviewPanel | undefined> {
const logger: Logger = getLogger()
try {
const client = new AccessAnalyzer({ region: context.regionProvider.defaultRegionId })
const client = new AccessAnalyzerClient({ region: context.regionProvider.defaultRegionId })
// Read from settings to auto-fill some inputs
const checkNoNewAccessFilePath: string = vscode.workspace
.getConfiguration()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as picker from '../../../shared/ui/picker'
import * as vscode from 'vscode'
import { ProgressLocation } from 'vscode'

import { Stage } from 'aws-sdk/clients/apigateway'
import { Stage } from '@aws-sdk/client-api-gateway'
import { ApiGatewayClient } from '../../../shared/clients/apiGateway'
import { defaultDnsSuffix, RegionProvider } from '../../../shared/regions/regionProvider'
import { getLogger } from '../../../shared/logger/logger'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase'
import { PlaceholderNode } from '../../../shared/treeview/nodes/placeholderNode'
import { compareTreeItems, makeChildrenNodes } from '../../../shared/treeview/utils'
import { ApiGatewayClient } from '../../../shared/clients/apiGateway'
import { RestApi } from 'aws-sdk/clients/apigateway'
import { RestApi } from '@aws-sdk/client-api-gateway'
import { toArrayAsync, toMap, updateInPlace } from '../../../shared/utilities/collectionUtils'
import { RestApiNode } from './apiNodes'

Expand Down
Loading
Loading