Skip to content

Commit 039cc8f

Browse files
Merge master into feature/amazonqLSP
2 parents 97b109f + 76ebe24 commit 039cc8f

32 files changed

+258
-294
lines changed

packages/core/src/awsService/apprunner/explorer/apprunnerServiceNode.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import { AppRunnerNode } from './apprunnerNode'
1010

1111
import { toArrayAsync, toMap } from '../../../shared/utilities/collectionUtils'
1212
import { CloudWatchLogsBase } from '../../../awsService/cloudWatchLogs/explorer/cloudWatchLogsNode'
13-
import { CloudWatchLogs } from 'aws-sdk'
1413
import { AWSResourceNode } from '../../../shared/treeview/nodes/awsResourceNode'
1514

1615
import * as nls from 'vscode-nls'
1716
import { getLogger } from '../../../shared/logger/logger'
1817
import { getIcon } from '../../../shared/icons'
19-
import { DefaultCloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogsClient'
18+
import { CloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogs'
19+
import { LogGroup } from '@aws-sdk/client-cloudwatch-logs'
2020
const localize = nls.loadMessageBundle()
2121

2222
const contextBase = 'awsAppRunnerServiceNode'
@@ -43,7 +43,7 @@ export class AppRunnerServiceNode extends CloudWatchLogsBase implements AWSResou
4343
private readonly client: AppRunnerClient,
4444
private _info: AppRunner.Service,
4545
private currentOperation: AppRunner.OperationSummary & { Type?: ServiceOperation } = {},
46-
cloudwatchClient = new DefaultCloudWatchLogsClient(client.regionCode)
46+
cloudwatchClient = new CloudWatchLogsClient(client.regionCode)
4747
) {
4848
super('App Runner Service', parent.regionCode, cloudwatchClient)
4949

@@ -63,7 +63,7 @@ export class AppRunnerServiceNode extends CloudWatchLogsBase implements AWSResou
6363
return `https://${this._info.ServiceUrl}`
6464
}
6565

66-
protected async getLogGroups(): Promise<Map<string, CloudWatchLogs.LogGroup>> {
66+
protected async getLogGroups(): Promise<Map<string, LogGroup>> {
6767
return toMap(
6868
await toArrayAsync(
6969
this.cloudwatchClient.describeLogGroups({

packages/core/src/awsService/cloudWatchLogs/commands/searchLogGroup.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ import {
1717
import { DataQuickPickItem } from '../../../shared/ui/pickerPrompter'
1818
import { isValidResponse, isWizardControl, Wizard, WIZARD_RETRY } from '../../../shared/wizards/wizard'
1919
import { cwlUriSchema, msgKey, recordTelemetryFilter } from '../cloudWatchLogsUtils'
20-
import { DefaultCloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogsClient'
20+
import { CloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogs'
2121
import { CancellationError } from '../../../shared/utilities/timeoutUtils'
2222
import { getLogger } from '../../../shared/logger/logger'
2323
import { TimeFilterResponse, TimeFilterSubmenu } from '../timeFilterSubmenu'
24-
import { CloudWatchLogs } from 'aws-sdk'
2524
import { ExtendedInputBoxOptions, InputBox, InputBoxPrompter } from '../../../shared/ui/inputPrompter'
2625
import { RegionSubmenu, RegionSubmenuResponse } from '../../../shared/ui/common/regionSubmenu'
2726
import { truncate } from '../../../shared/utilities/textUtilities'
@@ -30,6 +29,7 @@ import { PromptResult } from '../../../shared/ui/prompter'
3029
import { ToolkitError } from '../../../shared/errors'
3130
import { Messages } from '../../../shared/utilities/messages'
3231
import { showFile } from '../../../shared/utilities/textDocumentUtilities'
32+
import { LogGroup } from '@aws-sdk/client-cloudwatch-logs'
3333

3434
const localize = nls.loadMessageBundle()
3535

@@ -110,7 +110,7 @@ export async function searchLogGroup(
110110
}
111111

112112
async function getLogGroupsFromRegion(regionCode: string): Promise<DataQuickPickItem<string>[]> {
113-
const client = new DefaultCloudWatchLogsClient(regionCode)
113+
const client = new CloudWatchLogsClient(regionCode)
114114
const logGroups = await logGroupsToArray(client.describeLogGroups())
115115
const options = logGroups.map<DataQuickPickItem<string>>((logGroupString) => ({
116116
label: logGroupString,
@@ -119,7 +119,7 @@ async function getLogGroupsFromRegion(regionCode: string): Promise<DataQuickPick
119119
return options
120120
}
121121

122-
async function logGroupsToArray(logGroups: AsyncIterableIterator<CloudWatchLogs.LogGroup>): Promise<string[]> {
122+
async function logGroupsToArray(logGroups: AsyncIterableIterator<LogGroup>): Promise<string[]> {
123123
const logGroupsArray = []
124124
for await (const logGroupObject of logGroups) {
125125
logGroupObject.logGroupName && logGroupsArray.push(logGroupObject.logGroupName)

packages/core/src/awsService/cloudWatchLogs/commands/viewLogStream.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import * as vscode from 'vscode'
1010
import * as picker from '../../../shared/ui/picker'
1111
import { MultiStepWizard, WIZARD_RETRY, WIZARD_TERMINATE, WizardStep } from '../../../shared/wizards/multiStepWizard'
1212
import { LogGroupNode } from '../explorer/logGroupNode'
13-
import { CloudWatchLogs } from 'aws-sdk'
14-
15-
import { DefaultCloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogsClient'
13+
import * as CloudWatchLogs from '@aws-sdk/client-cloudwatch-logs'
14+
import { CloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogs'
1615
import { getPaginatedAwsCallIter, IteratorTransformer } from '../../../shared/utilities/collectionUtils'
1716
import {
1817
CloudWatchLogsGroupInfo,
@@ -82,7 +81,7 @@ export class DefaultSelectLogStreamWizardContext implements SelectLogStreamWizar
8281
) {}
8382

8483
public async pickLogStream(): Promise<LogSearchChoice> {
85-
const client = new DefaultCloudWatchLogsClient(this.regionCode)
84+
const client = new CloudWatchLogsClient(this.regionCode)
8685
const request: CloudWatchLogs.DescribeLogStreamsRequest = {
8786
logGroupName: this.logGroupName,
8887
orderBy: 'LastEventTime',

packages/core/src/awsService/cloudWatchLogs/explorer/cloudWatchLogsNode.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
import * as nls from 'vscode-nls'
77
const localize = nls.loadMessageBundle()
88

9-
import { CloudWatchLogs } from 'aws-sdk'
109
import * as vscode from 'vscode'
1110

12-
import { DefaultCloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogsClient'
11+
import { CloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogs'
1312

1413
import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase'
1514
import { toMap, updateInPlace, toArrayAsync } from '../../../shared/utilities/collectionUtils'
1615
import { PlaceholderNode } from '../../../shared/treeview/nodes/placeholderNode'
1716
import { makeChildrenNodes } from '../../../shared/treeview/utils'
1817
import { LogGroupNode } from './logGroupNode'
18+
import { LogGroup } from '@aws-sdk/client-cloudwatch-logs'
1919

2020
export abstract class CloudWatchLogsBase extends AWSTreeNodeBase {
2121
protected readonly logGroupNodes: Map<string, LogGroupNode>
@@ -24,13 +24,13 @@ export abstract class CloudWatchLogsBase extends AWSTreeNodeBase {
2424
public constructor(
2525
label: string,
2626
public override readonly regionCode: string,
27-
protected readonly cloudwatchClient: DefaultCloudWatchLogsClient
27+
protected readonly cloudwatchClient: CloudWatchLogsClient
2828
) {
2929
super(label, vscode.TreeItemCollapsibleState.Collapsed)
3030
this.logGroupNodes = new Map<string, LogGroupNode>()
3131
}
3232

33-
protected abstract getLogGroups(client: DefaultCloudWatchLogsClient): Promise<Map<string, CloudWatchLogs.LogGroup>>
33+
protected abstract getLogGroups(client: CloudWatchLogsClient): Promise<Map<string, LogGroup>>
3434

3535
public override async getChildren(): Promise<AWSTreeNodeBase[]> {
3636
return await makeChildrenNodes({
@@ -58,12 +58,12 @@ export abstract class CloudWatchLogsBase extends AWSTreeNodeBase {
5858
export class CloudWatchLogsNode extends CloudWatchLogsBase {
5959
protected readonly placeholderMessage = localize('AWS.explorerNode.cloudWatchLogs.nologs', '[No log groups found]')
6060

61-
public constructor(regionCode: string, client = new DefaultCloudWatchLogsClient(regionCode)) {
61+
public constructor(regionCode: string, client = new CloudWatchLogsClient(regionCode)) {
6262
super('CloudWatch Logs', regionCode, client)
6363
this.contextValue = 'awsCloudWatchLogParentNode'
6464
}
6565

66-
protected async getLogGroups(client: DefaultCloudWatchLogsClient): Promise<Map<string, CloudWatchLogs.LogGroup>> {
66+
protected async getLogGroups(client: CloudWatchLogsClient): Promise<Map<string, LogGroup>> {
6767
return toMap(await toArrayAsync(client.describeLogGroups()), (configuration) => configuration.logGroupName)
6868
}
6969
}

packages/core/src/awsService/cloudWatchLogs/explorer/logGroupNode.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { CloudWatchLogs } from 'aws-sdk'
76
import * as os from 'os'
87
import { AWSResourceNode } from '../../../shared/treeview/nodes/awsResourceNode'
98
import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase'
109
import { getIcon } from '../../../shared/icons'
1110
import { localize } from '../../../shared/utilities/vsCodeUtils'
11+
import { LogGroup } from '@aws-sdk/client-cloudwatch-logs'
1212

1313
export const contextValueCloudwatchLog = 'awsCloudWatchLogNode'
1414

1515
export class LogGroupNode extends AWSTreeNodeBase implements AWSResourceNode {
1616
public constructor(
1717
public override readonly regionCode: string,
18-
public logGroup: CloudWatchLogs.LogGroup
18+
public logGroup: LogGroup
1919
) {
2020
super('')
2121
this.update(logGroup)
@@ -28,7 +28,7 @@ export class LogGroupNode extends AWSTreeNodeBase implements AWSResourceNode {
2828
}
2929
}
3030

31-
public update(logGroup: CloudWatchLogs.LogGroup): void {
31+
public update(logGroup: LogGroup): void {
3232
this.logGroup = logGroup
3333
this.label = this.logGroup.logGroupName || ''
3434
this.tooltip = `${this.logGroup.logGroupName}${os.EOL}${this.logGroup.arn}`

packages/core/src/awsService/cloudWatchLogs/registry/logDataRegistry.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
*/
55

66
import * as vscode from 'vscode'
7-
import { CloudWatchLogs } from 'aws-sdk'
87
import { CloudWatchLogsSettings, uriToKey, msgKey, cwlUriSchema } from '../cloudWatchLogsUtils'
9-
import { DefaultCloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogsClient'
8+
import { CloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogs'
109
import { waitTimeout } from '../../../shared/utilities/timeoutUtils'
1110
import { Messages } from '../../../shared/utilities/messages'
1211
import { pageableToCollection } from '../../../shared/utilities/collectionUtils'
1312
import { Settings } from '../../../shared/settings'
13+
import * as CloudWatchLogs from '@aws-sdk/client-cloudwatch-logs'
1414
// TODO: Add debug logging statements
1515

1616
/** Uri as a string */
@@ -212,7 +212,7 @@ export async function filterLogEventsFromUri(
212212
nextToken?: string,
213213
completeTimeout = false
214214
): Promise<CloudWatchLogsResponse> {
215-
const client = new DefaultCloudWatchLogsClient(logGroupInfo.regionName)
215+
const client = new CloudWatchLogsClient(logGroupInfo.regionName)
216216

217217
const cwlParameters: CloudWatchLogs.FilterLogEventsRequest = {
218218
logGroupName: logGroupInfo.groupName,
@@ -301,9 +301,9 @@ export type CloudWatchLogsParameters = {
301301
}
302302

303303
export type CloudWatchLogsResponse = {
304-
events: CloudWatchLogs.FilteredLogEvents
305-
nextForwardToken?: CloudWatchLogs.NextToken
306-
nextBackwardToken?: CloudWatchLogs.NextToken
304+
events: CloudWatchLogs.FilteredLogEvent[]
305+
nextForwardToken?: string
306+
nextBackwardToken?: string
307307
}
308308

309309
export type CloudWatchLogsAction = (
@@ -323,10 +323,10 @@ export class CloudWatchLogsData {
323323
logGroupInfo!: CloudWatchLogsGroupInfo
324324
retrieveLogsFunction!: CloudWatchLogsAction
325325
next?: {
326-
token: CloudWatchLogs.NextToken
326+
token: string
327327
}
328328
previous?: {
329-
token: CloudWatchLogs.NextToken
329+
token: string
330330
}
331331
busy: boolean = false
332332
}

packages/core/src/awsService/cloudWatchLogs/wizard/liveTailLogStreamSubmenu.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55
import { Prompter, PromptResult } from '../../../shared/ui/prompter'
6-
import { DefaultCloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogsClient'
6+
import { CloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogs'
77
import { createCommonButtons } from '../../../shared/ui/buttons'
88
import { createInputBox, InputBoxPrompter } from '../../../shared/ui/inputPrompter'
99
import { createQuickPick, DataQuickPickItem, QuickPickPrompter } from '../../../shared/ui/pickerPrompter'
1010
import { pageableToCollection } from '../../../shared/utilities/collectionUtils'
11-
import { CloudWatchLogs } from 'aws-sdk'
11+
import * as CloudWatchLogs from '@aws-sdk/client-cloudwatch-logs'
1212
import { isValidResponse, StepEstimator } from '../../../shared/wizards/wizard'
1313
import { isNonNullable } from '../../../shared/utilities/tsUtils'
1414
import {
@@ -87,7 +87,7 @@ export class LogStreamFilterSubmenu extends Prompter<LogStreamFilterResponse> {
8787

8888
public createLogStreamSelector(): QuickPickPrompter<string> {
8989
const helpUri = startLiveTailLogStreamNamesHelpUrl
90-
const client = new DefaultCloudWatchLogsClient(this.region)
90+
const client = new CloudWatchLogsClient(this.region)
9191
const request: CloudWatchLogs.DescribeLogStreamsRequest = {
9292
logGroupIdentifier: this.logGroupArn,
9393
orderBy: 'LastEventTime',

packages/core/src/awsService/cloudWatchLogs/wizard/tailLogGroupWizard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import * as nls from 'vscode-nls'
77
import globals from '../../../shared/extensionGlobals'
88
import { ToolkitError } from '../../../shared/errors'
9-
import { DefaultCloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogsClient'
9+
import { CloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogs'
1010
import { cwlFilterPatternHelpUrl } from '../../../shared/constants'
1111
import { createBackButton, createExitButton, createHelpButton } from '../../../shared/ui/buttons'
1212
import { RegionSubmenu, RegionSubmenuResponse } from '../../../shared/ui/common/regionSubmenu'
@@ -64,7 +64,7 @@ export function createRegionLogGroupSubmenu(): RegionSubmenu<string> {
6464
}
6565

6666
async function getLogGroupQuickPickOptions(regionCode: string): Promise<DataQuickPickItem<string>[]> {
67-
const client = new DefaultCloudWatchLogsClient(regionCode)
67+
const client = new CloudWatchLogsClient(regionCode)
6868
const logGroups = client.describeLogGroups()
6969

7070
const logGroupsOptions: DataQuickPickItem<string>[] = []

packages/core/src/dynamicResources/awsResourceManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { writeFileSync } from 'fs' // eslint-disable-line no-restricted-imports
77
import * as path from 'path'
88
import * as vscode from 'vscode'
9-
import { CloudFormationClient } from '../shared/clients/cloudFormationClient'
9+
import { CloudFormationClient } from '../shared/clients/cloudFormation'
1010
import {
1111
getNonexistentFilename,
1212
makeTemporaryToolkitFolder,

packages/core/src/dynamicResources/explorer/nodes/resourcesNode.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66
import * as vscode from 'vscode'
77
import * as nls from 'vscode-nls'
8-
import { CloudFormationClient, DefaultCloudFormationClient } from '../../../shared/clients/cloudFormationClient'
8+
import { CloudFormationClient } from '../../../shared/clients/cloudFormation'
99
import { AWSTreeNodeBase } from '../../../shared/treeview/nodes/awsTreeNodeBase'
1010
import { PlaceholderNode } from '../../../shared/treeview/nodes/placeholderNode'
1111
import { makeChildrenNodes } from '../../../shared/treeview/utils'
1212
import { toArrayAsync, updateInPlace } from '../../../shared/utilities/collectionUtils'
1313
import { ResourceTypeNode } from './resourceTypeNode'
14-
import { CloudFormation } from 'aws-sdk'
1514
import { CloudControlClient } from '../../../shared/clients/cloudControl'
1615
import { memoizedGetResourceTypes, ResourceTypeMetadata } from '../../model/resources'
1716
import { ResourcesSettings } from '../../commands/configure'
17+
import { TypeSummary } from '@aws-sdk/client-cloudformation'
1818

1919
const localize = nls.loadMessageBundle()
2020

@@ -23,7 +23,7 @@ export class ResourcesNode extends AWSTreeNodeBase {
2323

2424
public constructor(
2525
public readonly region: string,
26-
public readonly cloudFormation: CloudFormationClient = new DefaultCloudFormationClient(region),
26+
public readonly cloudFormation: CloudFormationClient = new CloudFormationClient(region),
2727
private readonly cloudControl: CloudControlClient = new CloudControlClient(region),
2828
private readonly settings = new ResourcesSettings()
2929
) {
@@ -62,7 +62,7 @@ export class ResourcesNode extends AWSTreeNodeBase {
6262
const types = await toArrayAsync(this.cloudFormation.listTypes())
6363
types.sort((a, b) => (a.LastUpdated?.getTime() ?? 0) - (b.LastUpdated?.getTime() ?? 0))
6464

65-
const availableTypes: Map<string, CloudFormation.TypeSummary> = new Map()
65+
const availableTypes: Map<string, TypeSummary> = new Map()
6666
for (const type of types) {
6767
if (type.TypeName) {
6868
availableTypes.set(type.TypeName!, type)

0 commit comments

Comments
 (0)