From 7351e52832367e4137204208074836ea5ddfb56c Mon Sep 17 00:00:00 2001 From: hkobew Date: Wed, 18 Sep 2024 12:50:19 -0400 Subject: [PATCH 01/11] add empty command --- packages/core/package.json | 20 ++++++++++++++++++++ packages/core/package.nls.json | 1 + 2 files changed, 21 insertions(+) diff --git a/packages/core/package.json b/packages/core/package.json index 9103481db6..2171b22947 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1181,6 +1181,10 @@ { "command": "aws.toolkit.auth.manageConnections" }, + { + "command": "aws.ec2.viewLogs", + "when": "aws.isDevMode" + }, { "command": "aws.ec2.openRemoteConnection", "when": "aws.isDevMode" @@ -1556,6 +1560,11 @@ "when": "view == aws.explorer && viewItem =~ /^(awsEc2(Parent|Running|Stopped)Node)$/", "group": "2@0" }, + { + "command": "aws.ec2.viewLogs", + "when": "view == aws.explorer && viewItem =~ /^(awsEc2(Pending|Running|Stopped)Node)$/", + "group": "3@0" + }, { "command": "aws.ecr.copyTagUri", "when": "view == aws.explorer && viewItem == awsEcrTagNode", @@ -2241,6 +2250,17 @@ } } }, + { + "command": "aws.ec2.viewLogs", + "title": "%AWS.command.ec2.viewLogs%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, { "command": "aws.ec2.openTerminal", "title": "%AWS.command.ec2.openTerminal%", diff --git a/packages/core/package.nls.json b/packages/core/package.nls.json index 125b3fc605..032561e1fb 100644 --- a/packages/core/package.nls.json +++ b/packages/core/package.nls.json @@ -127,6 +127,7 @@ "AWS.command.ec2.stopInstance": "Stop EC2 Instance", "AWS.command.ec2.rebootInstance": "Reboot EC2 Instance", "AWS.command.ec2.copyInstanceId": "Copy Instance Id", + "AWS.command.ec2.viewLogs": "View logs", "AWS.command.ecr.copyTagUri": "Copy Tag URI", "AWS.command.ecr.copyRepositoryUri": "Copy Repository URI", "AWS.command.ecr.createRepository": "Create Repository...", From 5d9451d8dde06df56d7b7df8c6cdb2b6790b0154 Mon Sep 17 00:00:00 2001 From: hkobew Date: Wed, 18 Sep 2024 14:44:00 -0400 Subject: [PATCH 02/11] show system log in logs --- packages/core/package.nls.json | 2 +- .../core/src/awsService/ec2/activation.ts | 8 + packages/core/src/shared/clients/ec2Client.ts | 15 + packages/toolkit/package.json | 3186 ++++++++++++++++- 4 files changed, 3106 insertions(+), 105 deletions(-) diff --git a/packages/core/package.nls.json b/packages/core/package.nls.json index 032561e1fb..2a2e2ae31d 100644 --- a/packages/core/package.nls.json +++ b/packages/core/package.nls.json @@ -127,7 +127,7 @@ "AWS.command.ec2.stopInstance": "Stop EC2 Instance", "AWS.command.ec2.rebootInstance": "Reboot EC2 Instance", "AWS.command.ec2.copyInstanceId": "Copy Instance Id", - "AWS.command.ec2.viewLogs": "View logs", + "AWS.command.ec2.viewLogs": "View system logs", "AWS.command.ecr.copyTagUri": "Copy Tag URI", "AWS.command.ecr.copyRepositoryUri": "Copy Repository URI", "AWS.command.ecr.createRepository": "Create Repository...", diff --git a/packages/core/src/awsService/ec2/activation.ts b/packages/core/src/awsService/ec2/activation.ts index 94da1906e4..9f4c1f670f 100644 --- a/packages/core/src/awsService/ec2/activation.ts +++ b/packages/core/src/awsService/ec2/activation.ts @@ -16,6 +16,8 @@ import { stopInstance, refreshExplorer, } from './commands' +import { getLogger } from '../../shared' +import { Ec2Client } from '../../shared/clients/ec2Client' export async function activate(ctx: ExtContext): Promise { ctx.extensionContext.subscriptions.push( @@ -29,6 +31,12 @@ export async function activate(ctx: ExtContext): Promise { Commands.register('aws.ec2.copyInstanceId', async (node: Ec2InstanceNode) => { await copyTextCommand(node, 'id') }), + Commands.register('aws.ec2.viewLogs', async (node: Ec2InstanceNode) => { + getLogger().info('viewLogs command run from explorer') + const ec2Client = new Ec2Client(node.regionCode) + const rsp = await ec2Client.getConsoleOutput(node.InstanceId, false) + getLogger().info(rsp.Output) + }), Commands.register('aws.ec2.openRemoteConnection', async (node?: Ec2Node) => { await openRemoteConnection(node) diff --git a/packages/core/src/shared/clients/ec2Client.ts b/packages/core/src/shared/clients/ec2Client.ts index cee2e22366..b7d3b3a767 100644 --- a/packages/core/src/shared/clients/ec2Client.ts +++ b/packages/core/src/shared/clients/ec2Client.ts @@ -22,6 +22,11 @@ export interface SafeEc2Instance extends EC2.Instance { LastSeenStatus: EC2.InstanceStateName } +interface SafeEc2GetConsoleOutputResult extends EC2.GetConsoleOutputRequest { + Output: string + InstanceId: string +} + export class Ec2Client { public constructor(public readonly regionCode: string) {} @@ -229,6 +234,16 @@ export class Ec2Client { const association = await this.getIamInstanceProfileAssociation(instanceId) return association ? association.IamInstanceProfile : undefined } + + public async getConsoleOutput(instanceId: string, latest: boolean): Promise { + const client = await this.createSdkClient() + const response = await client.getConsoleOutput({ InstanceId: instanceId, Latest: latest }).promise() + return { + ...response, + InstanceId: instanceId, + Output: response.Output ? Buffer.from(response.Output, 'base64').toString() : '', + } + } } export function getNameOfInstance(instance: EC2.Instance): string | undefined { diff --git a/packages/toolkit/package.json b/packages/toolkit/package.json index ecdae4246b..bf52f062cc 100644 --- a/packages/toolkit/package.json +++ b/packages/toolkit/package.json @@ -51,7 +51,10 @@ ], "main": "./dist/src/extensionNode", "browser": "./dist/src/extensionWeb", - "engines": "This field will be autopopulated from the core module during debugging and packaging.", + "engines": { + "npm": "^10.1.0", + "vscode": "^1.68.0" + }, "scripts": { "vscode:prepublish": "npm run clean && npm run buildScripts && webpack --mode production", "buildScripts": "npm run generateNonCodeFiles && npm run copyFiles && npm run generateIcons && npm run generateSettings && npm run generateConfigurationAttributes && tsc -p ./ --noEmit", @@ -674,119 +677,3067 @@ ] } ], - "icons": { - "aws-amazonq-q-gradient": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1aa" - } - }, - "aws-amazonq-q-squid-ink": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1ab" - } - }, - "aws-amazonq-q-white": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1ac" - } - }, - "aws-amazonq-transform-arrow-dark": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1ad" - } - }, - "aws-amazonq-transform-arrow-light": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1ae" - } - }, - "aws-amazonq-transform-default-dark": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1af" - } - }, - "aws-amazonq-transform-default-light": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b0" - } - }, - "aws-amazonq-transform-dependencies-dark": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b1" + "viewsContainers": { + "activitybar": [ + { + "id": "aws-explorer", + "title": "%AWS.title%", + "icon": "resources/aws-logo.svg", + "cloud9": { + "cn": { + "title": "%AWS.title.cn%", + "icon": "resources/aws-cn-logo.svg" + } + } } - }, - "aws-amazonq-transform-dependencies-light": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b2" + ] + }, + "views": { + "aws-explorer": [ + { + "id": "aws.amazonq.codewhisperer", + "name": "%AWS.amazonq.codewhisperer.title%", + "when": "!isCloud9 && !aws.isSageMaker && !aws.toolkit.amazonq.dismissed && !aws.explorer.showAuthView" + }, + { + "id": "aws.explorer", + "name": "%AWS.lambda.explorerTitle%", + "when": "(isCloud9 || !aws.isWebExtHost) && !aws.explorer.showAuthView" + }, + { + "id": "aws.cdk", + "name": "%AWS.cdk.explorerTitle%", + "when": "!aws.explorer.showAuthView" + }, + { + "id": "aws.codecatalyst", + "name": "%AWS.codecatalyst.explorerTitle%", + "when": "(!isCloud9 && !aws.isSageMaker || isCloud9CodeCatalyst) && !aws.explorer.showAuthView" + }, + { + "type": "webview", + "id": "aws.toolkit.AmazonCommonAuth", + "name": "%AWS.amazonq.login%", + "when": "!isCloud9 && !aws.isSageMaker && aws.explorer.showAuthView" } + ] + }, + "submenus": [ + { + "id": "aws.toolkit.auth", + "label": "%AWS.submenu.auth.title%", + "icon": "$(ellipsis)", + "when": "isCloud9 || !aws.isWebExtHost" }, - "aws-amazonq-transform-file-dark": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b3" - } + { + "id": "aws.codecatalyst.submenu", + "label": "%AWS.codecatalyst.submenu.title%", + "icon": "$(ellipsis)", + "when": "isCloud9 || !aws.isWebExtHost" }, - "aws-amazonq-transform-file-light": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b4" - } + { + "label": "%AWS.generic.feedback%", + "id": "aws.toolkit.submenu.feedback" }, - "aws-amazonq-transform-logo": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b5" + { + "label": "%AWS.generic.help%", + "id": "aws.toolkit.submenu.help" + } + ], + "menus": { + "commandPalette": [ + { + "command": "aws.apig.copyUrl", + "when": "false" + }, + { + "command": "aws.apig.invokeRemoteRestApi", + "when": "false" + }, + { + "command": "aws.deleteCloudFormation", + "when": "false" + }, + { + "command": "aws.downloadStateMachineDefinition", + "when": "false" + }, + { + "command": "aws.ecr.createRepository", + "when": "false" + }, + { + "command": "aws.executeStateMachine", + "when": "false" + }, + { + "command": "aws.copyArn", + "when": "false" + }, + { + "command": "aws.copyName", + "when": "false" + }, + { + "command": "aws.listCommands", + "when": "false" + }, + { + "command": "aws.codecatalyst.listCommands", + "when": "false" + }, + { + "command": "aws.codecatalyst.manageConnections", + "when": "false" + }, + { + "command": "aws.codecatalyst.openDevEnv", + "when": "!isCloud9" + }, + { + "command": "aws.codecatalyst.createDevEnv", + "when": "!isCloud9" + }, + { + "command": "aws.downloadSchemaItemCode", + "when": "false" + }, + { + "command": "aws.deleteLambda", + "when": "false" + }, + { + "command": "aws.downloadLambda", + "when": "false" + }, + { + "command": "aws.invokeLambda", + "when": "false" + }, + { + "command": "aws.copyLambdaUrl", + "when": "false" + }, + { + "command": "aws.viewSchemaItem", + "when": "false" + }, + { + "command": "aws.searchSchema", + "when": "false" + }, + { + "command": "aws.searchSchemaPerRegistry", + "when": "false" + }, + { + "command": "aws.refreshAwsExplorer", + "when": "false" + }, + { + "command": "aws.cdk.refresh", + "when": "false" + }, + { + "command": "aws.cdk.viewDocs", + "when": "false" + }, + { + "command": "aws.ssmDocument.openLocalDocument", + "when": "false" + }, + { + "command": "aws.ssmDocument.openLocalDocumentJson", + "when": "false" + }, + { + "command": "aws.ssmDocument.openLocalDocumentYaml", + "when": "false" + }, + { + "command": "aws.ssmDocument.deleteDocument", + "when": "false" + }, + { + "command": "aws.ssmDocument.updateDocumentVersion", + "when": "false" + }, + { + "command": "aws.copyLogResource", + "when": "resourceScheme == aws-cwl" + }, + { + "command": "aws.saveCurrentLogDataContent", + "when": "resourceScheme == aws-cwl" + }, + { + "command": "aws.s3.editFile", + "when": "resourceScheme == s3-readonly" + }, + { + "command": "aws.cwl.viewLogStream", + "when": "false" + }, + { + "command": "aws.cwl.changeFilterPattern", + "when": "false" + }, + { + "command": "aws.cwl.changeTimeFilter", + "when": "false" + }, + { + "command": "aws.ecr.deleteRepository", + "when": "false" + }, + { + "command": "aws.ecr.copyTagUri", + "when": "false" + }, + { + "command": "aws.ecr.copyRepositoryUri", + "when": "false" + }, + { + "command": "aws.ecr.deleteTag", + "when": "false" + }, + { + "command": "aws.iot.createThing", + "when": "false" + }, + { + "command": "aws.iot.deleteThing", + "when": "false" + }, + { + "command": "aws.iot.createCert", + "when": "false" + }, + { + "command": "aws.iot.deleteCert", + "when": "false" + }, + { + "command": "aws.iot.attachCert", + "when": "false" + }, + { + "command": "aws.iot.attachPolicy", + "when": "false" + }, + { + "command": "aws.iot.activateCert", + "when": "false" + }, + { + "command": "aws.iot.deactivateCert", + "when": "false" + }, + { + "command": "aws.iot.revokeCert", + "when": "false" + }, + { + "command": "aws.iot.createPolicy", + "when": "false" + }, + { + "command": "aws.iot.deletePolicy", + "when": "false" + }, + { + "command": "aws.iot.createPolicyVersion", + "when": "false" + }, + { + "command": "aws.iot.deletePolicyVersion", + "when": "false" + }, + { + "command": "aws.iot.detachCert", + "when": "false" + }, + { + "command": "aws.iot.detachPolicy", + "when": "false" + }, + { + "command": "aws.iot.viewPolicyVersion", + "when": "false" + }, + { + "command": "aws.iot.setDefaultPolicy", + "when": "false" + }, + { + "command": "aws.iot.copyEndpoint", + "when": "false" + }, + { + "command": "aws.deploySamApplication", + "when": "config.aws.samcli.legacyDeploy" + }, + { + "command": "aws.redshift.editConnection", + "when": "false" + }, + { + "command": "aws.redshift.deleteConnection", + "when": "false" + }, + { + "command": "aws.samcli.sync", + "when": "!config.aws.samcli.legacyDeploy" + }, + { + "command": "aws.s3.copyPath", + "when": "false" + }, + { + "command": "aws.s3.createBucket", + "when": "false" + }, + { + "command": "aws.s3.createFolder", + "when": "false" + }, + { + "command": "aws.s3.deleteBucket", + "when": "false" + }, + { + "command": "aws.s3.deleteFile", + "when": "false" + }, + { + "command": "aws.s3.downloadFileAs", + "when": "false" + }, + { + "command": "aws.s3.openFile", + "when": "false" + }, + { + "command": "aws.s3.editFile", + "when": "false" + }, + { + "command": "aws.s3.uploadFileToParent", + "when": "false" + }, + { + "command": "aws.apprunner.startDeployment", + "when": "false" + }, + { + "command": "aws.apprunner.createService", + "when": "false" + }, + { + "command": "aws.apprunner.pauseService", + "when": "false" + }, + { + "command": "aws.apprunner.resumeService", + "when": "false" + }, + { + "command": "aws.apprunner.copyServiceUrl", + "when": "false" + }, + { + "command": "aws.apprunner.open", + "when": "false" + }, + { + "command": "aws.apprunner.deleteService", + "when": "false" + }, + { + "command": "aws.apprunner.createServiceFromEcr", + "when": "false" + }, + { + "command": "aws.resources.copyIdentifier", + "when": "false" + }, + { + "command": "aws.resources.openResourcePreview", + "when": "false" + }, + { + "command": "aws.resources.createResource", + "when": "false" + }, + { + "command": "aws.resources.deleteResource", + "when": "false" + }, + { + "command": "aws.resources.updateResource", + "when": "false" + }, + { + "command": "aws.resources.updateResourceInline", + "when": "false" + }, + { + "command": "aws.resources.saveResource", + "when": "false" + }, + { + "command": "aws.resources.closeResource", + "when": "false" + }, + { + "command": "aws.resources.viewDocs", + "when": "false" + }, + { + "command": "aws.ecs.runCommandInContainer", + "when": "false" + }, + { + "command": "aws.ecs.openTaskInTerminal", + "when": "false" + }, + { + "command": "aws.ecs.enableEcsExec", + "when": "false" + }, + { + "command": "aws.ecs.disableEcsExec", + "when": "false" + }, + { + "command": "aws.ecs.viewDocumentation", + "when": "false" + }, + { + "command": "aws.renderStateMachineGraph", + "when": "false" + }, + { + "command": "aws.toolkit.auth.addConnection", + "when": "false" + }, + { + "command": "aws.toolkit.auth.switchConnections", + "when": "false" + }, + { + "command": "aws.toolkit.auth.help", + "when": "false" + }, + { + "command": "aws.toolkit.auth.manageConnections" + }, + { + "command": "aws.ec2.viewLogs", + "when": "aws.isDevMode" + }, + { + "command": "aws.ec2.openRemoteConnection", + "when": "aws.isDevMode" + }, + { + "command": "aws.ec2.openTerminal", + "when": "aws.isDevMode" + }, + { + "command": "aws.ec2.startInstance", + "when": "aws.isDevMode" + }, + { + "command": "aws.ec2.stopInstance", + "when": "aws.isDevMode" + }, + { + "command": "aws.ec2.rebootInstance", + "when": "aws.isDevMode" + }, + { + "command": "aws.dev.openMenu", + "when": "aws.isDevMode || isCloud9" + }, + { + "command": "aws.openInApplicationComposer", + "when": "false" + }, + { + "command": "aws.toolkit.amazonq.learnMore", + "when": "false" + }, + { + "command": "aws.toolkit.amazonq.extensionpage", + "when": "false" + }, + { + "command": "aws.newThreatComposerFile", + "when": "false" } - }, - "aws-amazonq-transform-step-into-dark": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b6" + ], + "editor/title": [ + { + "command": "aws.previewStateMachine", + "when": "editorLangId == asl || editorLangId == asl-yaml", + "group": "navigation" + }, + { + "command": "aws.saveCurrentLogDataContent", + "when": "resourceScheme == aws-cwl", + "group": "navigation" + }, + { + "command": "aws.cwl.changeFilterPattern", + "when": "resourceScheme == aws-cwl", + "group": "navigation" + }, + { + "command": "aws.cwl.changeTimeFilter", + "when": "resourceScheme == aws-cwl", + "group": "navigation" + }, + { + "command": "aws.s3.editFile", + "when": "resourceScheme == s3-readonly", + "group": "navigation" + }, + { + "command": "aws.ssmDocument.publishDocument", + "when": "editorLangId =~ /^(ssm-yaml|ssm-json)$/", + "group": "navigation" + }, + { + "command": "aws.resources.updateResourceInline", + "when": "resourceScheme == awsResource && !isCloud9 && config.aws.experiments.jsonResourceModification", + "group": "navigation" + }, + { + "command": "aws.resources.closeResource", + "when": "resourcePath =~ /^.+(awsResource.json)$/", + "group": "navigation" + }, + { + "command": "aws.resources.saveResource", + "when": "resourcePath =~ /^.+(awsResource.json)$/", + "group": "navigation" + }, + { + "command": "aws.openInApplicationComposer", + "when": "(editorLangId == json && !(resourceFilename =~ /^.*\\.tc\\.json$/)) || editorLangId == yaml || resourceFilename =~ /^.*\\.(template)$/", + "group": "navigation" } - }, - "aws-amazonq-transform-step-into-light": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b7" + ], + "editor/title/context": [ + { + "command": "aws.copyLogResource", + "when": "resourceScheme == aws-cwl", + "group": "1_cutcopypaste@1" } - }, - "aws-amazonq-transform-variables-dark": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b8" + ], + "view/title": [ + { + "command": "aws.toolkit.submitFeedback", + "when": "view == aws.explorer && !aws.isWebExtHost", + "group": "navigation@6" + }, + { + "command": "aws.refreshAwsExplorer", + "when": "view == aws.explorer", + "group": "navigation@5" + }, + { + "command": "aws.cdk.refresh", + "when": "view == aws.cdk", + "group": "navigation@1" + }, + { + "command": "aws.toolkit.login", + "when": "view == aws.explorer", + "group": "1_account@1" + }, + { + "command": "aws.showRegion", + "when": "view == aws.explorer", + "group": "1_account@2" + }, + { + "command": "aws.listCommands", + "when": "view == aws.explorer && !isCloud9", + "group": "1_account@3" + }, + { + "command": "aws.lambda.createNewSamApp", + "when": "view == aws.explorer", + "group": "3_lambda@1" + }, + { + "command": "aws.launchConfigForm", + "when": "view == aws.explorer", + "group": "3_lambda@2" + }, + { + "command": "aws.deploySamApplication", + "when": "config.aws.samcli.legacyDeploy && view == aws.explorer", + "group": "3_lambda@3" + }, + { + "command": "aws.samcli.sync", + "when": "!config.aws.samcli.legacyDeploy && view == aws.explorer", + "group": "3_lambda@3" + }, + { + "submenu": "aws.toolkit.submenu.feedback", + "when": "view =~ /^aws\\./ && view != aws.AmazonQChatView && view != aws.amazonq.AmazonCommonAuth", + "group": "y_toolkitMeta@1" + }, + { + "submenu": "aws.toolkit.submenu.help", + "when": "view =~ /^aws\\./ && view != aws.AmazonQChatView && view != aws.amazonq.AmazonCommonAuth", + "group": "y_toolkitMeta@2" + }, + { + "command": "aws.codecatalyst.cloneRepo", + "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", + "group": "1_codeCatalyst@1" + }, + { + "command": "aws.codecatalyst.createDevEnv", + "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", + "group": "1_codeCatalyst@1" + }, + { + "command": "aws.codecatalyst.listCommands", + "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", + "group": "1_codeCatalyst@1" + }, + { + "command": "aws.codecatalyst.openDevEnv", + "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", + "group": "1_codeCatalyst@1" + }, + { + "command": "aws.codecatalyst.manageConnections", + "when": "view == aws.codecatalyst && !isCloud9 && !aws.codecatalyst.connected", + "group": "2_codeCatalyst@1" + }, + { + "command": "aws.codecatalyst.signout", + "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", + "group": "2_codeCatalyst@1" } - }, - "aws-amazonq-transform-variables-light": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b9" + ], + "explorer/context": [ + { + "command": "aws.deploySamApplication", + "when": "config.aws.samcli.legacyDeploy && isFileSystemResource && resourceFilename =~ /^template\\.(json|yml|yaml)$/", + "group": "z_aws@1" + }, + { + "command": "aws.samcli.sync", + "when": "!config.aws.samcli.legacyDeploy && isFileSystemResource && resourceFilename =~ /^(template\\.(json|yml|yaml))|(samconfig\\.toml)$/", + "group": "z_aws@1" + }, + { + "command": "aws.uploadLambda", + "when": "explorerResourceIsFolder || isFileSystemResource && resourceFilename =~ /^template\\.(json|yml|yaml)$/", + "group": "z_aws@3" + }, + { + "command": "aws.openInApplicationComposer", + "when": "isFileSystemResource && !(resourceFilename =~ /^.*\\.tc\\.json$/) && resourceFilename =~ /^.*\\.(json|yml|yaml|template)$/", + "group": "z_aws@1" } - }, + ], + "view/item/context": [ + { + "command": "aws.apig.invokeRemoteRestApi", + "when": "view == aws.explorer && viewItem =~ /^(awsApiGatewayNode)$/", + "group": "0@1" + }, + { + "command": "aws.ec2.openTerminal", + "group": "0@1", + "when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/" + }, + { + "command": "aws.ec2.openTerminal", + "group": "inline@1", + "when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/" + }, + { + "command": "aws.ec2.openRemoteConnection", + "group": "0@1", + "when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/" + }, + { + "command": "aws.ec2.openRemoteConnection", + "group": "inline@1", + "when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/" + }, + { + "command": "aws.ec2.startInstance", + "group": "0@1", + "when": "viewItem == awsEc2StoppedNode" + }, + { + "command": "aws.ec2.startInstance", + "group": "inline@1", + "when": "viewItem == awsEc2StoppedNode" + }, + { + "command": "aws.ec2.stopInstance", + "group": "0@1", + "when": "viewItem == awsEc2RunningNode" + }, + { + "command": "aws.ec2.stopInstance", + "group": "inline@1", + "when": "viewItem == awsEc2RunningNode" + }, + { + "command": "aws.ec2.rebootInstance", + "group": "0@1", + "when": "viewItem == awsEc2RunningNode" + }, + { + "command": "aws.ec2.rebootInstance", + "group": "inline@1", + "when": "viewItem == awsEc2RunningNode" + }, + { + "command": "aws.ecr.createRepository", + "when": "view == aws.explorer && viewItem == awsEcrNode", + "group": "inline@1" + }, + { + "command": "aws.iot.createThing", + "when": "view == aws.explorer && viewItem == awsIotThingsNode", + "group": "inline@1" + }, + { + "command": "aws.iot.createCert", + "when": "view == aws.explorer && viewItem == awsIotCertsNode", + "group": "inline@1" + }, + { + "command": "aws.iot.createPolicy", + "when": "view == aws.explorer && viewItem == awsIotPoliciesNode", + "group": "inline@1" + }, + { + "command": "aws.iot.attachCert", + "when": "view == aws.explorer && viewItem == awsIotThingNode", + "group": "inline@1" + }, + { + "command": "aws.iot.attachPolicy", + "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies)/", + "group": "inline@1" + }, + { + "command": "aws.redshift.editConnection", + "when": "view == aws.explorer && viewItem == awsRedshiftWarehouseNode", + "group": "0@1" + }, + { + "command": "aws.redshift.deleteConnection", + "when": "view == aws.explorer && viewItem == awsRedshiftWarehouseNode", + "group": "0@2" + }, + { + "command": "aws.s3.openFile", + "when": "view == aws.explorer && viewItem == awsS3FileNode && !isCloud9", + "group": "0@1" + }, + { + "command": "aws.s3.editFile", + "when": "view == aws.explorer && viewItem == awsS3FileNode && !isCloud9", + "group": "inline@1" + }, + { + "command": "aws.s3.downloadFileAs", + "when": "view == aws.explorer && viewItem == awsS3FileNode", + "group": "inline@2" + }, + { + "command": "aws.s3.createBucket", + "when": "view == aws.explorer && viewItem == awsS3Node", + "group": "inline@1" + }, + { + "command": "aws.s3.createFolder", + "when": "view == aws.explorer && viewItem =~ /^(awsS3BucketNode|awsS3FolderNode)$/", + "group": "inline@1" + }, + { + "command": "aws.ssmDocument.openLocalDocument", + "when": "view == aws.explorer && viewItem =~ /^(awsDocumentItemNode|awsDocumentItemNodeWriteable)$/", + "group": "inline@1" + }, + { + "command": "aws.s3.uploadFile", + "when": "view == aws.explorer && viewItem =~ /^(awsS3BucketNode|awsS3FolderNode)$/", + "group": "inline@2" + }, + { + "command": "aws.showRegion", + "when": "view == aws.explorer && viewItem == awsRegionNode", + "group": "0@1" + }, + { + "command": "aws.lambda.createNewSamApp", + "when": "view == aws.explorer && viewItem == awsLambdaNode || viewItem == awsRegionNode", + "group": "1@1" + }, + { + "command": "aws.launchConfigForm", + "when": "view == aws.explorer && viewItem == awsLambdaNode || viewItem == awsRegionNode || viewItem == awsCloudFormationRootNode", + "group": "1@1" + }, + { + "command": "aws.deploySamApplication", + "when": "config.aws.samcli.legacyDeploy && view == aws.explorer && viewItem =~ /^(awsLambdaNode|awsRegionNode|awsCloudFormationRootNode)$/", + "group": "1@2" + }, + { + "command": "aws.samcli.sync", + "when": "!config.aws.samcli.legacyDeploy && view == aws.explorer && viewItem =~ /^(awsLambdaNode|awsRegionNode|awsCloudFormationRootNode)$/", + "group": "1@2" + }, + { + "command": "aws.ec2.copyInstanceId", + "when": "view == aws.explorer && viewItem =~ /^(awsEc2(Parent|Running|Stopped)Node)$/", + "group": "2@0" + }, + { + "command": "aws.ec2.viewLogs", + "when": "view == aws.explorer && viewItem =~ /^(awsEc2(Pending|Running|Stopped)Node)$/", + "group": "3@0" + }, + { + "command": "aws.ecr.copyTagUri", + "when": "view == aws.explorer && viewItem == awsEcrTagNode", + "group": "2@1" + }, + { + "command": "aws.ecr.deleteTag", + "when": "view == aws.explorer && viewItem == awsEcrTagNode", + "group": "3@1" + }, + { + "command": "aws.ecr.copyRepositoryUri", + "when": "view == aws.explorer && viewItem == awsEcrRepositoryNode", + "group": "2@1" + }, + { + "command": "aws.ecr.createRepository", + "when": "view == aws.explorer && viewItem == awsEcrNode", + "group": "0@1" + }, + { + "command": "aws.ecr.deleteRepository", + "when": "view == aws.explorer && viewItem == awsEcrRepositoryNode", + "group": "3@1" + }, + { + "command": "aws.invokeLambda", + "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode)$/", + "group": "0@1" + }, + { + "command": "aws.downloadLambda", + "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/", + "group": "0@2" + }, + { + "command": "aws.uploadLambda", + "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/", + "group": "1@1" + }, + { + "command": "aws.deleteLambda", + "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/", + "group": "4@1" + }, + { + "command": "aws.copyLambdaUrl", + "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/", + "group": "2@0" + }, + { + "command": "aws.deleteCloudFormation", + "when": "view == aws.explorer && viewItem == awsCloudFormationNode", + "group": "3@5" + }, + { + "command": "aws.searchSchema", + "when": "view == aws.explorer && viewItem == awsSchemasNode", + "group": "0@1" + }, + { + "command": "aws.searchSchemaPerRegistry", + "when": "view == aws.explorer && viewItem == awsRegistryItemNode", + "group": "0@1" + }, + { + "command": "aws.viewSchemaItem", + "when": "view == aws.explorer && viewItem == awsSchemaItemNode", + "group": "0@1" + }, + { + "command": "aws.stepfunctions.createStateMachineFromTemplate", + "when": "view == aws.explorer && viewItem == awsStepFunctionsNode", + "group": "0@1" + }, + { + "command": "aws.downloadStateMachineDefinition", + "when": "view == aws.explorer && viewItem == awsStateMachineNode", + "group": "0@1" + }, + { + "command": "aws.renderStateMachineGraph", + "when": "view == aws.explorer && viewItem == awsStateMachineNode", + "group": "0@2" + }, + { + "command": "aws.cdk.renderStateMachineGraph", + "when": "viewItem == awsCdkStateMachineNode", + "group": "inline@1" + }, + { + "command": "aws.cdk.renderStateMachineGraph", + "when": "viewItem == awsCdkStateMachineNode", + "group": "0@1" + }, + { + "command": "aws.executeStateMachine", + "when": "view == aws.explorer && viewItem == awsStateMachineNode", + "group": "0@3" + }, + { + "command": "aws.iot.createThing", + "when": "view == aws.explorer && viewItem == awsIotThingsNode", + "group": "0@1" + }, + { + "command": "aws.iot.createCert", + "when": "view == aws.explorer && viewItem == awsIotCertsNode", + "group": "0@1" + }, + { + "command": "aws.iot.createPolicy", + "when": "view == aws.explorer && viewItem == awsIotPoliciesNode", + "group": "0@1" + }, + { + "command": "aws.iot.createPolicyVersion", + "when": "view == aws.explorer && viewItem == awsIotPolicyNode.WithVersions", + "group": "0@1" + }, + { + "command": "aws.iot.viewPolicyVersion", + "when": "view == aws.explorer && viewItem =~ /^awsIotPolicyVersionNode./", + "group": "0@1" + }, + { + "command": "aws.iot.attachCert", + "when": "view == aws.explorer && viewItem == awsIotThingNode", + "group": "0@1" + }, + { + "command": "aws.iot.attachPolicy", + "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies)/", + "group": "0@1" + }, + { + "command": "aws.s3.createBucket", + "when": "view == aws.explorer && viewItem == awsS3Node", + "group": "0@1" + }, + { + "command": "aws.s3.downloadFileAs", + "when": "view == aws.explorer && viewItem == awsS3FileNode", + "group": "0@1" + }, + { + "command": "aws.s3.uploadFile", + "when": "view == aws.explorer && viewItem =~ /^(awsS3BucketNode|awsS3FolderNode)$/", + "group": "0@1" + }, + { + "command": "aws.s3.uploadFileToParent", + "when": "view == aws.explorer && viewItem == awsS3FileNode", + "group": "1@1" + }, + { + "command": "aws.s3.createFolder", + "when": "view == aws.explorer && viewItem =~ /^(awsS3BucketNode|awsS3FolderNode)$/", + "group": "1@1" + }, + { + "command": "aws.iot.deactivateCert", + "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies).ACTIVE$/", + "group": "1@1" + }, + { + "command": "aws.iot.activateCert", + "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies).INACTIVE$/", + "group": "1@1" + }, + { + "command": "aws.iot.revokeCert", + "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies).(ACTIVE|INACTIVE)$/", + "group": "1@2" + }, + { + "command": "aws.iot.setDefaultPolicy", + "when": "view == aws.explorer && viewItem == awsIotPolicyVersionNode.NONDEFAULT", + "group": "1@1" + }, + { + "command": "aws.iot.copyEndpoint", + "when": "view == aws.explorer && viewItem == awsIotNode", + "group": "2@1" + }, + { + "command": "aws.copyName", + "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode|awsStateMachineNode|awsCloudFormationNode|awsS3BucketNode|awsS3FolderNode|awsS3FileNode|awsApiGatewayNode|awsIotThingNode)$|^(awsAppRunnerServiceNode|awsIotCertificateNode|awsIotPolicyNode|awsIotPolicyVersionNode|(awsEc2(Running|Pending|Stopped)Node))/", + "group": "2@1" + }, + { + "command": "aws.copyArn", + "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode|awsStateMachineNode|awsCloudFormationNode|awsCloudWatchLogNode|awsS3BucketNode|awsS3FolderNode|awsS3FileNode|awsApiGatewayNode|awsEcrRepositoryNode|awsIotThingNode)$|^(awsAppRunnerServiceNode|awsEcsServiceNode|awsIotCertificateNode|awsIotPolicyNode|awsIotPolicyVersionNode|awsMdeInstanceNode|(awsEc2(Running|Pending|Stopped)Node))/", + "group": "2@2" + }, + { + "command": "aws.cwl.searchLogGroup", + "group": "0@1", + "when": "view == aws.explorer && viewItem =~ /^awsCloudWatchLogNode|awsCloudWatchLogParentNode$/" + }, + { + "command": "aws.cwl.searchLogGroup", + "group": "inline@1", + "when": "view == aws.explorer && viewItem =~ /^awsCloudWatchLogNode|awsCloudWatchLogParentNode$/" + }, + { + "command": "aws.apig.copyUrl", + "when": "view == aws.explorer && viewItem =~ /^(awsApiGatewayNode)$/", + "group": "2@0" + }, + { + "command": "aws.s3.copyPath", + "when": "view == aws.explorer && viewItem =~ /^(awsS3FolderNode|awsS3FileNode)$/", + "group": "2@3" + }, + { + "command": "aws.s3.presignedURL", + "when": "view == aws.explorer && viewItem =~ /^(awsS3FileNode)$/", + "group": "2@4" + }, + { + "command": "aws.iot.detachCert", + "when": "view == aws.explorer && viewItem =~ /^(awsIotCertificateNode.Things)/", + "group": "3@1" + }, + { + "command": "aws.iot.detachPolicy", + "when": "view == aws.explorer && viewItem == awsIotPolicyNode.Certificates", + "group": "3@1" + }, + { + "command": "aws.iot.deleteThing", + "when": "view == aws.explorer && viewItem == awsIotThingNode", + "group": "3@1" + }, + { + "command": "aws.iot.deleteCert", + "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.Policies/", + "group": "3@1" + }, + { + "command": "aws.iot.deletePolicy", + "when": "view == aws.explorer && viewItem == awsIotPolicyNode.WithVersions", + "group": "3@1" + }, + { + "command": "aws.iot.deletePolicyVersion", + "when": "view == aws.explorer && viewItem == awsIotPolicyVersionNode.NONDEFAULT", + "group": "3@1" + }, + { + "command": "aws.s3.deleteBucket", + "when": "view == aws.explorer && viewItem == awsS3BucketNode", + "group": "3@1" + }, + { + "command": "aws.s3.deleteFile", + "when": "view == aws.explorer && viewItem == awsS3FileNode", + "group": "3@1" + }, + { + "command": "aws.downloadSchemaItemCode", + "when": "view == aws.explorer && viewItem == awsSchemaItemNode", + "group": "1@1" + }, + { + "command": "aws.cwl.viewLogStream", + "group": "0@1", + "when": "view == aws.explorer && viewItem == awsCloudWatchLogNode" + }, + { + "command": "aws.ssmDocument.openLocalDocumentYaml", + "group": "0@1", + "when": "view == aws.explorer && viewItem =~ /^(awsDocumentItemNode|awsDocumentItemNodeWriteable)$/" + }, + { + "command": "aws.ssmDocument.openLocalDocumentJson", + "group": "0@2", + "when": "view == aws.explorer && viewItem =~ /^(awsDocumentItemNode|awsDocumentItemNodeWriteable)$/" + }, + { + "command": "aws.ssmDocument.updateDocumentVersion", + "group": "2@1", + "when": "view == aws.explorer && viewItem == awsDocumentItemNodeWriteable" + }, + { + "command": "aws.ssmDocument.deleteDocument", + "group": "3@2", + "when": "view == aws.explorer && viewItem == awsDocumentItemNodeWriteable" + }, + { + "command": "aws.ecs.runCommandInContainer", + "group": "0@1", + "when": "view == aws.explorer && viewItem =~ /^(awsEcsContainerNodeExec)(.*)$/" + }, + { + "command": "aws.ecs.openTaskInTerminal", + "group": "0@2", + "when": "view == aws.explorer && viewItem =~ /^(awsEcsContainerNodeExec)(.*)$/ && !isCloud9" + }, + { + "command": "aws.ecs.enableEcsExec", + "group": "0@2", + "when": "view == aws.explorer && viewItem == awsEcsServiceNode.DISABLED" + }, + { + "command": "aws.ecs.disableEcsExec", + "group": "0@2", + "when": "view == aws.explorer && viewItem == awsEcsServiceNode.ENABLED" + }, + { + "command": "aws.ecs.viewDocumentation", + "group": "1@3", + "when": "view == aws.explorer && viewItem =~ /^(awsEcsClusterNode|awsEcsContainerNode)$|^awsEcsServiceNode/" + }, + { + "command": "aws.resources.configure", + "when": "view == aws.explorer && viewItem == resourcesRootNode", + "group": "1@1" + }, + { + "command": "aws.resources.configure", + "when": "view == aws.explorer && viewItem == resourcesRootNode", + "group": "inline@1" + }, + { + "command": "aws.resources.openResourcePreview", + "when": "view == aws.explorer && viewItem =~ /^(.*)(ResourceNode)$/", + "group": "1@1" + }, + { + "command": "aws.resources.copyIdentifier", + "when": "view == aws.explorer && viewItem =~ /^(.*)(ResourceNode)$/", + "group": "1@1" + }, + { + "command": "aws.resources.viewDocs", + "when": "view == aws.explorer && viewItem =~ /^(.*)(Documented)(.*)(ResourceTypeNode)$/", + "group": "1@1" + }, + { + "command": "aws.resources.createResource", + "when": "view == aws.explorer && viewItem =~ /^(.*)(Creatable)(.*)(ResourceTypeNode)$/ && !isCloud9 && config.aws.experiments.jsonResourceModification", + "group": "2@1" + }, + { + "command": "aws.resources.createResource", + "when": "view == aws.explorer && viewItem =~ /^(.*)(Creatable)(.*)(ResourceTypeNode)$/ && !isCloud9 && config.aws.experiments.jsonResourceModification", + "group": "inline@1" + }, + { + "command": "aws.resources.updateResource", + "when": "view == aws.explorer && viewItem =~ /^(.*)(Updatable)(.*)(ResourceNode)$/ && !isCloud9 && config.aws.experiments.jsonResourceModification", + "group": "2@1" + }, + { + "command": "aws.resources.deleteResource", + "when": "view == aws.explorer && viewItem =~ /^(.*)(Deletable)(.*)(ResourceNode)$/ && !isCloud9 && config.aws.experiments.jsonResourceModification", + "group": "2@2" + }, + { + "command": "aws.apprunner.createServiceFromEcr", + "group": "0@2", + "when": "view == aws.explorer && viewItem =~ /awsEcrTagNode|awsEcrRepositoryNode/" + }, + { + "command": "aws.apprunner.startDeployment", + "group": "0@1", + "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.RUNNING" + }, + { + "command": "aws.apprunner.createService", + "group": "0@2", + "when": "view == aws.explorer && viewItem == awsAppRunnerNode" + }, + { + "command": "aws.apprunner.pauseService", + "group": "0@3", + "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.RUNNING" + }, + { + "command": "aws.apprunner.resumeService", + "group": "0@3", + "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.PAUSED" + }, + { + "command": "aws.apprunner.copyServiceUrl", + "group": "1@1", + "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.RUNNING" + }, + { + "command": "aws.apprunner.open", + "group": "1@2", + "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.RUNNING" + }, + { + "command": "aws.apprunner.deleteService", + "group": "3@1", + "when": "view == aws.explorer && viewItem =~ /awsAppRunnerServiceNode.[RUNNING|PAUSED|CREATE_FAILED]/" + }, + { + "command": "aws.cloudFormation.newTemplate", + "group": "0@1", + "when": "view == aws.explorer && viewItem == awsCloudFormationRootNode" + }, + { + "command": "aws.sam.newTemplate", + "group": "0@2", + "when": "view == aws.explorer && viewItem == awsCloudFormationRootNode" + }, + { + "command": "aws.cdk.viewDocs", + "when": "viewItem == awsCdkRootNode", + "group": "0@2" + }, + { + "command": "aws.toolkit.auth.addConnection", + "when": "viewItem == awsAuthNode", + "group": "0@1" + }, + { + "command": "aws.toolkit.auth.switchConnections", + "when": "viewItem == awsAuthNode", + "group": "0@2" + }, + { + "command": "aws.toolkit.auth.signout", + "when": "viewItem == awsAuthNode && !isCloud9", + "group": "0@3" + }, + { + "command": "aws.toolkit.auth.help", + "when": "viewItem == awsAuthNode", + "group": "inline@1" + }, + { + "submenu": "aws.toolkit.auth", + "when": "viewItem == awsAuthNode", + "group": "inline@2" + }, + { + "submenu": "aws.codecatalyst.submenu", + "when": "viewItem =~ /^awsCodeCatalystNode/", + "group": "inline@1" + }, + { + "command": "aws.codecatalyst.manageConnections", + "when": "viewItem =~ /^awsCodeCatalystNode/", + "group": "0@1" + }, + { + "command": "aws.codecatalyst.signout", + "when": "viewItem =~ /^awsCodeCatalystNode/&& !isCloud9 && aws.codecatalyst.connected", + "group": "0@2" + } + ], + "aws.toolkit.auth": [ + { + "command": "aws.toolkit.auth.manageConnections", + "group": "0@1" + }, + { + "command": "aws.toolkit.auth.switchConnections", + "group": "0@2" + }, + { + "command": "aws.toolkit.auth.signout", + "enablement": "!isCloud9", + "group": "0@3" + } + ], + "aws.toolkit.submenu.feedback": [ + { + "command": "aws.toolkit.submitFeedback", + "when": "!aws.isWebExtHost", + "group": "1_feedback@1" + }, + { + "command": "aws.toolkit.createIssueOnGitHub", + "group": "1_feedback@2" + } + ], + "aws.toolkit.submenu.help": [ + { + "command": "aws.quickStart", + "when": "isCloud9", + "group": "1_help@1" + }, + { + "command": "aws.toolkit.help", + "group": "1_help@2" + }, + { + "command": "aws.toolkit.github", + "group": "1_help@3" + }, + { + "command": "aws.toolkit.aboutExtension", + "group": "1_help@4" + }, + { + "command": "aws.toolkit.viewLogs", + "group": "1_help@5" + } + ], + "file/newFile": [ + { + "command": "aws.newThreatComposerFile" + } + ] + }, + "commands": [ + { + "command": "aws.accessanalyzer.iamPolicyChecks", + "title": "%AWS.command.accessanalyzer.iamPolicyChecks%", + "category": "%AWS.title%" + }, + { + "command": "aws.launchConfigForm", + "title": "%AWS.command.launchConfigForm.title%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apig.copyUrl", + "title": "%AWS.command.apig.copyUrl%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apig.invokeRemoteRestApi", + "title": "%AWS.command.apig.invokeRemoteRestApi%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%", + "title": "%AWS.command.apig.invokeRemoteRestApi.cn%" + } + } + }, + { + "command": "aws.lambda.createNewSamApp", + "title": "%AWS.command.createNewSamApp%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.toolkit.login", + "title": "%AWS.command.login%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "title": "%AWS.command.login.cn%", + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.toolkit.credentials.profile.create", + "title": "%AWS.command.credentials.profile.create%", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.toolkit.credentials.edit", + "title": "%AWS.command.credentials.edit%", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.codecatalyst.openOrg", + "title": "%AWS.command.codecatalyst.openOrg%", + "category": "AWS", + "enablement": "isCloud9 || !aws.isWebExtHost" + }, + { + "command": "aws.codecatalyst.openProject", + "title": "%AWS.command.codecatalyst.openProject%", + "category": "AWS", + "enablement": "isCloud9 || !aws.isWebExtHost" + }, + { + "command": "aws.codecatalyst.openRepo", + "title": "%AWS.command.codecatalyst.openRepo%", + "category": "AWS", + "enablement": "isCloud9 || !aws.isWebExtHost" + }, + { + "command": "aws.codecatalyst.openDevEnv", + "title": "%AWS.command.codecatalyst.openDevEnv%", + "category": "AWS", + "enablement": "!isCloud9 && !aws.isWebExtHost" + }, + { + "command": "aws.codecatalyst.listCommands", + "title": "%AWS.command.codecatalyst.listCommands%", + "category": "AWS", + "enablement": "!isCloud9 && !aws.isWebExtHost" + }, + { + "command": "aws.codecatalyst.cloneRepo", + "title": "%AWS.command.codecatalyst.cloneRepo%", + "category": "AWS", + "enablement": "!isCloud9 && !aws.isWebExtHost" + }, + { + "command": "aws.codecatalyst.createDevEnv", + "title": "%AWS.command.codecatalyst.createDevEnv%", + "category": "AWS", + "enablement": "!isCloud9 && !aws.isWebExtHost" + }, + { + "command": "aws.codecatalyst.signout", + "title": "%AWS.command.codecatalyst.signout%", + "category": "AWS", + "icon": "$(debug-disconnect)", + "enablement": "isCloud9 || !aws.isWebExtHost" + }, + { + "command": "aws.toolkit.auth.addConnection", + "title": "%AWS.command.auth.addConnection%", + "category": "%AWS.title%" + }, + { + "command": "aws.toolkit.auth.manageConnections", + "title": "%AWS.command.auth.showConnectionsPage%", + "category": "%AWS.title%" + }, + { + "command": "aws.codecatalyst.manageConnections", + "title": "%AWS.command.auth.showConnectionsPage%", + "category": "%AWS.title%" + }, + { + "command": "aws.toolkit.auth.switchConnections", + "title": "%AWS.command.auth.switchConnections%", + "category": "%AWS.title%" + }, + { + "command": "aws.toolkit.auth.signout", + "title": "%AWS.command.auth.signout%", + "category": "%AWS.title%", + "enablement": "!isCloud9" + }, + { + "command": "aws.toolkit.auth.help", + "title": "%AWS.generic.viewDocs%", + "category": "%AWS.title%", + "icon": "$(question)" + }, + { + "command": "aws.toolkit.createIssueOnGitHub", + "title": "%AWS.command.createIssueOnGitHub%", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ec2.viewLogs", + "title": "%AWS.command.ec2.viewLogs%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ec2.openTerminal", + "title": "%AWS.command.ec2.openTerminal%", + "icon": "$(terminal-view-icon)", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ec2.openRemoteConnection", + "title": "%AWS.command.ec2.openRemoteConnection%", + "icon": "$(remote-explorer)", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ec2.startInstance", + "title": "%AWS.command.ec2.startInstance%", + "icon": "$(debug-start)", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ec2.stopInstance", + "title": "%AWS.command.ec2.stopInstance%", + "icon": "$(debug-stop)", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ec2.rebootInstance", + "title": "%AWS.command.ec2.rebootInstance%", + "icon": "$(debug-restart)", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ec2.copyInstanceId", + "title": "%AWS.command.ec2.copyInstanceId%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecr.copyTagUri", + "title": "%AWS.command.ecr.copyTagUri%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecr.deleteTag", + "title": "%AWS.command.ecr.deleteTag%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecr.copyRepositoryUri", + "title": "%AWS.command.ecr.copyRepositoryUri%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecr.createRepository", + "title": "%AWS.command.ecr.createRepository%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(add)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecr.deleteRepository", + "title": "%AWS.command.ecr.deleteRepository%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.showRegion", + "title": "%AWS.command.showRegion%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.createThing", + "title": "%AWS.command.iot.createThing%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(add)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.deleteThing", + "title": "%AWS.generic.promptDelete%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.createCert", + "title": "%AWS.command.iot.createCert%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(add)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.deleteCert", + "title": "%AWS.generic.promptDelete%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.attachCert", + "title": "%AWS.command.iot.attachCert%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(aws-generic-attach-file)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.attachPolicy", + "title": "%AWS.command.iot.attachPolicy%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(aws-generic-attach-file)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.activateCert", + "title": "%AWS.command.iot.activateCert%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.deactivateCert", + "title": "%AWS.command.iot.deactivateCert%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.revokeCert", + "title": "%AWS.command.iot.revokeCert%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.createPolicy", + "title": "%AWS.command.iot.createPolicy%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(add)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.deletePolicy", + "title": "%AWS.generic.promptDelete%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.createPolicyVersion", + "title": "%AWS.command.iot.createPolicyVersion%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.deletePolicyVersion", + "title": "%AWS.generic.promptDelete%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.detachCert", + "title": "%AWS.command.iot.detachCert%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.detachPolicy", + "title": "%AWS.command.iot.detachCert%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.viewPolicyVersion", + "title": "%AWS.command.iot.viewPolicyVersion%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.setDefaultPolicy", + "title": "%AWS.command.iot.setDefaultPolicy%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.iot.copyEndpoint", + "title": "%AWS.command.iot.copyEndpoint%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.redshift.editConnection", + "title": "Edit connection", + "category": "%AWS.title%" + }, + { + "command": "aws.redshift.deleteConnection", + "title": "Delete connection", + "category": "%AWS.title%" + }, + { + "command": "aws.s3.presignedURL", + "title": "%AWS.command.s3.presignedURL%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost" + }, + { + "command": "aws.s3.copyPath", + "title": "%AWS.command.s3.copyPath%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.s3.downloadFileAs", + "title": "%AWS.command.s3.downloadFileAs%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(cloud-download)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.s3.openFile", + "title": "%AWS.command.s3.openFile%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(open-preview)" + }, + { + "command": "aws.s3.editFile", + "title": "%AWS.command.s3.editFile%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(edit)" + }, + { + "command": "aws.s3.uploadFile", + "title": "%AWS.command.s3.uploadFile%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(cloud-upload)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.s3.uploadFileToParent", + "title": "%AWS.command.s3.uploadFileToParent%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.s3.createFolder", + "title": "%AWS.command.s3.createFolder%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(new-folder)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.s3.createBucket", + "title": "%AWS.command.s3.createBucket%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(aws-s3-create-bucket)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.s3.deleteBucket", + "title": "%AWS.generic.promptDelete%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.s3.deleteFile", + "title": "%AWS.generic.promptDelete%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.invokeLambda", + "title": "%AWS.command.invokeLambda%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "title": "%AWS.command.invokeLambda.cn%", + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.downloadLambda", + "title": "%AWS.command.downloadLambda%", + "category": "%AWS.title%", + "enablement": "viewItem == awsRegionFunctionNodeDownloadable", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.uploadLambda", + "title": "%AWS.command.uploadLambda%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.deleteLambda", + "title": "%AWS.generic.promptDelete%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.copyLambdaUrl", + "title": "%AWS.generic.copyUrl%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.deploySamApplication", + "title": "%AWS.command.deploySamApplication%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.toolkit.submitFeedback", + "title": "%AWS.command.submitFeedback%", + "enablement": "!aws.isWebExtHost", + "category": "%AWS.title%", + "icon": "$(comment)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.refreshAwsExplorer", + "title": "%AWS.command.refreshAwsExplorer%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "icon": { + "dark": "resources/icons/vscode/dark/refresh.svg", + "light": "resources/icons/vscode/light/refresh.svg" + } + }, + { + "command": "aws.samcli.detect", + "title": "%AWS.command.samcli.detect%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.deleteCloudFormation", + "title": "%AWS.command.deleteCloudFormation%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.downloadStateMachineDefinition", + "title": "%AWS.command.downloadStateMachineDefinition%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.executeStateMachine", + "title": "%AWS.command.executeStateMachine%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.renderStateMachineGraph", + "title": "%AWS.command.renderStateMachineGraph%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.copyArn", + "title": "%AWS.command.copyArn%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.copyName", + "title": "%AWS.command.copyName%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.listCommands", + "title": "%AWS.command.listCommands%", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "title": "%AWS.command.listCommands.cn%", + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.viewSchemaItem", + "title": "%AWS.command.viewSchemaItem%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.searchSchema", + "title": "%AWS.command.searchSchema%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.searchSchemaPerRegistry", + "title": "%AWS.command.searchSchemaPerRegistry%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.downloadSchemaItemCode", + "title": "%AWS.command.downloadSchemaItemCode%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.toolkit.viewLogs", + "title": "%AWS.command.viewLogs%", + "category": "%AWS.title%" + }, + { + "command": "aws.toolkit.help", + "title": "%AWS.command.help%", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.toolkit.github", + "title": "%AWS.command.github%", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.quickStart", + "title": "%AWS.command.quickStart%", + "category": "%AWS.title%", + "enablement": "isCloud9", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.cdk.refresh", + "title": "%AWS.command.refreshCdkExplorer%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": { + "dark": "resources/icons/vscode/dark/refresh.svg", + "light": "resources/icons/vscode/light/refresh.svg" + }, + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.cdk.viewDocs", + "title": "%AWS.generic.viewDocs%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost" + }, + { + "command": "aws.stepfunctions.createStateMachineFromTemplate", + "title": "%AWS.command.stepFunctions.createStateMachineFromTemplate%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.stepfunctions.publishStateMachine", + "title": "%AWS.command.stepFunctions.publishStateMachine%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.previewStateMachine", + "title": "%AWS.command.stepFunctions.previewStateMachine%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(aws-stepfunctions-preview)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.cdk.renderStateMachineGraph", + "title": "%AWS.command.cdk.previewStateMachine%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "AWS", + "icon": "$(aws-stepfunctions-preview)" + }, + { + "command": "aws.toolkit.aboutExtension", + "title": "%AWS.command.aboutToolkit%", + "category": "%AWS.title%" + }, + { + "command": "aws.cwl.viewLogStream", + "title": "%AWS.command.viewLogStream%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ssmDocument.createLocalDocument", + "title": "%AWS.command.ssmDocument.createLocalDocument%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ssmDocument.openLocalDocument", + "title": "%AWS.command.ssmDocument.openLocalDocument%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(cloud-download)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ssmDocument.openLocalDocumentJson", + "title": "%AWS.command.ssmDocument.openLocalDocumentJson%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ssmDocument.openLocalDocumentYaml", + "title": "%AWS.command.ssmDocument.openLocalDocumentYaml%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ssmDocument.deleteDocument", + "title": "%AWS.command.ssmDocument.deleteDocument%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ssmDocument.publishDocument", + "title": "%AWS.command.ssmDocument.publishDocument%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(cloud-upload)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ssmDocument.updateDocumentVersion", + "title": "%AWS.command.ssmDocument.updateDocumentVersion%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.copyLogResource", + "title": "%AWS.command.copyLogResource%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(files)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.cwl.searchLogGroup", + "title": "%AWS.command.cloudWatchLogs.searchLogGroup%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(search-view-icon)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.saveCurrentLogDataContent", + "title": "%AWS.command.saveCurrentLogDataContent%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(save)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.cwl.changeFilterPattern", + "title": "%AWS.command.cwl.changeFilterPattern%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(search-view-icon)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.cwl.changeTimeFilter", + "title": "%AWS.command.cwl.changeTimeFilter%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(calendar)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.addSamDebugConfig", + "title": "%AWS.command.addSamDebugConfig%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.toggleSamCodeLenses", + "title": "%AWS.command.toggleSamCodeLenses%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecs.runCommandInContainer", + "title": "%AWS.ecs.runCommandInContainer%", + "category": "%AWS.title%", + "enablement": "viewItem == awsEcsContainerNodeExecEnabled", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecs.openTaskInTerminal", + "title": "%AWS.ecs.openTaskInTerminal%", + "category": "%AWS.title%", + "enablement": "viewItem == awsEcsContainerNodeExecEnabled", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecs.enableEcsExec", + "title": "%AWS.ecs.enableEcsExec%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecs.viewDocumentation", + "title": "%AWS.generic.viewDocs%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.copyIdentifier", + "title": "%AWS.command.resources.copyIdentifier%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.openResourcePreview", + "title": "%AWS.generic.preview%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(open-preview)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.createResource", + "title": "%AWS.generic.create%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(add)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.deleteResource", + "title": "%AWS.generic.promptDelete%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.updateResource", + "title": "%AWS.generic.promptUpdate%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(pencil)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.updateResourceInline", + "title": "%AWS.generic.promptUpdate%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(pencil)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.saveResource", + "title": "%AWS.generic.save%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(save)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.closeResource", + "title": "%AWS.generic.close%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(close)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.viewDocs", + "title": "%AWS.generic.viewDocs%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(book)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.resources.configure", + "title": "%AWS.command.resources.configure%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "icon": "$(gear)", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apprunner.createService", + "title": "%AWS.command.apprunner.createService%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.ecs.disableEcsExec", + "title": "%AWS.ecs.disableEcsExec%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apprunner.createServiceFromEcr", + "title": "%AWS.command.apprunner.createServiceFromEcr%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apprunner.pauseService", + "title": "%AWS.command.apprunner.pauseService%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apprunner.resumeService", + "title": "%AWS.command.apprunner.resumeService%", + "category": "AWS", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apprunner.copyServiceUrl", + "title": "%AWS.command.apprunner.copyServiceUrl%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apprunner.open", + "title": "%AWS.command.apprunner.open%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apprunner.deleteService", + "title": "%AWS.generic.promptDelete%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.apprunner.startDeployment", + "title": "%AWS.command.apprunner.startDeployment%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.cloudFormation.newTemplate", + "title": "%AWS.command.cloudFormation.newTemplate%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.sam.newTemplate", + "title": "%AWS.command.sam.newTemplate%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.samcli.sync", + "title": "%AWS.command.samcli.sync%", + "category": "%AWS.title%", + "enablement": "isCloud9 || !aws.isWebExtHost" + }, + { + "command": "aws.toolkit.amazonq.learnMore", + "title": "%AWS.amazonq.learnMore%", + "category": "%AWS.title%" + }, + { + "command": "aws.toolkit.amazonq.extensionpage", + "title": "Open Amazon Q Extension", + "category": "%AWS.title%" + }, + { + "command": "aws.dev.openMenu", + "title": "Open Developer Menu", + "category": "AWS (Developer)", + "enablement": "aws.isDevMode" + }, + { + "command": "aws.dev.viewLogs", + "title": "Watch Logs", + "category": "AWS (Developer)" + }, + { + "command": "aws.openInApplicationComposerDialog", + "title": "%AWS.command.applicationComposer.openDialog%", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.openInApplicationComposer", + "title": "%AWS.command.applicationComposer.open%", + "category": "%AWS.title%", + "icon": { + "dark": "resources/icons/aws/applicationcomposer/icon-dark.svg", + "light": "resources/icons/aws/applicationcomposer/icon.svg" + }, + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.createNewThreatComposer", + "title": "%AWS.command.threatComposer.createNew%", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + }, + { + "command": "aws.newThreatComposerFile", + "title": "%AWS.command.threatComposer.newFile%", + "category": "%AWS.title%", + "cloud9": { + "cn": { + "category": "%AWS.title.cn%" + } + } + } + ], + "jsonValidation": [ + { + "fileMatch": ".aws/templates.json", + "url": "./dist/src/templates/templates.json" + }, + { + "fileMatch": "*ecs-task-def.json", + "url": "https://ecs-intellisense.s3-us-west-2.amazonaws.com/task-definition/schema.json" + } + ], + "languages": [ + { + "id": "asl", + "extensions": [ + ".asl.json", + ".asl" + ], + "aliases": [ + "Amazon States Language" + ] + }, + { + "id": "asl-yaml", + "aliases": [ + "Amazon States Language (YAML)" + ], + "extensions": [ + ".asl.yaml", + ".asl.yml" + ] + }, + { + "id": "ssm-json", + "extensions": [ + ".ssm.json" + ], + "aliases": [ + "AWS Systems Manager Document (JSON)" + ] + }, + { + "id": "ssm-yaml", + "extensions": [ + ".ssm.yaml", + ".ssm.yml" + ], + "aliases": [ + "AWS Systems Manager Document (YAML)" + ] + } + ], + "keybindings": [ + { + "command": "aws.previewStateMachine", + "key": "ctrl+shift+v", + "mac": "cmd+shift+v", + "when": "editorTextFocus && editorLangId == asl || editorTextFocus && editorLangId == asl-yaml" + } + ], + "grammars": [ + { + "language": "asl", + "scopeName": "source.asl", + "path": "./syntaxes/ASL.tmLanguage" + }, + { + "language": "asl-yaml", + "scopeName": "source.asl.yaml", + "path": "./syntaxes/asl-yaml.tmLanguage.json" + }, + { + "language": "ssm-json", + "scopeName": "source.ssmjson", + "path": "./syntaxes/SSMJSON.tmLanguage" + }, + { + "language": "ssm-yaml", + "scopeName": "source.ssmyaml", + "path": "./syntaxes/SSMYAML.tmLanguage" + } + ], + "resourceLabelFormatters": [ + { + "scheme": "aws-cwl", + "formatting": { + "label": "${path}", + "separator": "/" + } + }, + { + "scheme": "s3*", + "formatting": { + "label": "[S3] ${path}", + "separator": "/" + } + } + ], + "walkthroughs": [], + "icons": { + "aws-amazonq-q-gradient": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1aa" + } + }, + "aws-amazonq-q-squid-ink": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1ab" + } + }, + "aws-amazonq-q-white": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1ac" + } + }, + "aws-amazonq-transform-arrow-dark": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1ad" + } + }, + "aws-amazonq-transform-arrow-light": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1ae" + } + }, + "aws-amazonq-transform-default-dark": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1af" + } + }, + "aws-amazonq-transform-default-light": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b0" + } + }, + "aws-amazonq-transform-dependencies-dark": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b1" + } + }, + "aws-amazonq-transform-dependencies-light": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b2" + } + }, + "aws-amazonq-transform-file-dark": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b3" + } + }, + "aws-amazonq-transform-file-light": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b4" + } + }, + "aws-amazonq-transform-logo": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b5" + } + }, + "aws-amazonq-transform-step-into-dark": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b6" + } + }, + "aws-amazonq-transform-step-into-light": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b7" + } + }, + "aws-amazonq-transform-variables-dark": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b8" + } + }, + "aws-amazonq-transform-variables-light": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b9" + } + }, "aws-applicationcomposer-icon": { "description": "AWS Contributed Icon", "default": { @@ -1018,6 +3969,33 @@ "fontCharacter": "\\f1da" } } + }, + "notebooks": [ + { + "type": "aws-redshift-sql-notebook", + "displayName": "Redshift SQL notebook", + "selector": [ + { + "filenamePattern": "*.redshiftnb" + } + ] + } + ], + "customEditors": [ + { + "viewType": "threatComposer.tc.json", + "displayName": "%AWS.threatComposer.title%", + "selector": [ + { + "filenamePattern": "*.tc.json" + } + ] + } + ], + "configurationDefaults": { + "workbench.editorAssociations": { + "{git,gitlens,conflictResolution,vscode-local-history}:/**/*.tc.json": "default" + } } }, "devDependencies": {}, From f1199f0a1b1c1643b54aca38dda2662bda2bc020 Mon Sep 17 00:00:00 2001 From: hkobew Date: Wed, 18 Sep 2024 15:01:56 -0400 Subject: [PATCH 03/11] factor out uses of decode --- packages/core/src/lambda/vue/remoteInvoke/invokeLambda.ts | 3 ++- packages/core/src/shared/clients/ec2Client.ts | 3 ++- packages/core/src/shared/utilities/textUtilities.ts | 4 ++++ packages/core/src/test/setupUtil.ts | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/core/src/lambda/vue/remoteInvoke/invokeLambda.ts b/packages/core/src/lambda/vue/remoteInvoke/invokeLambda.ts index 852537800f..d8f8911d15 100644 --- a/packages/core/src/lambda/vue/remoteInvoke/invokeLambda.ts +++ b/packages/core/src/lambda/vue/remoteInvoke/invokeLambda.ts @@ -20,6 +20,7 @@ import * as nls from 'vscode-nls' import { VueWebview } from '../../../webviews/main' import { telemetry } from '../../../shared/telemetry/telemetry' import { Result } from '../../../shared/telemetry/telemetry' +import { decodeBase64 } from '../../../shared' const localize = nls.loadMessageBundle() @@ -61,7 +62,7 @@ export class RemoteInvokeWebview extends VueWebview { try { const funcResponse = await this.client.invoke(this.data.FunctionArn, input) - const logs = funcResponse.LogResult ? Buffer.from(funcResponse.LogResult, 'base64').toString() : '' + const logs = funcResponse.LogResult ? decodeBase64(funcResponse.LogResult) : '' const payload = funcResponse.Payload ? funcResponse.Payload : JSON.stringify({}) this.channel.appendLine(`Invocation result for ${this.data.FunctionArn}`) diff --git a/packages/core/src/shared/clients/ec2Client.ts b/packages/core/src/shared/clients/ec2Client.ts index b7d3b3a767..6b031ce02b 100644 --- a/packages/core/src/shared/clients/ec2Client.ts +++ b/packages/core/src/shared/clients/ec2Client.ts @@ -12,6 +12,7 @@ import { PromiseResult } from 'aws-sdk/lib/request' import { Timeout } from '../utilities/timeoutUtils' import { showMessageWithCancel } from '../utilities/messages' import { ToolkitError, isAwsError } from '../errors' +import { decodeBase64 } from '../utilities/textUtilities' /** * A wrapper around EC2.Instance where we can safely assume InstanceId field exists. @@ -241,7 +242,7 @@ export class Ec2Client { return { ...response, InstanceId: instanceId, - Output: response.Output ? Buffer.from(response.Output, 'base64').toString() : '', + Output: response.Output ? decodeBase64(response.Output) : '', } } } diff --git a/packages/core/src/shared/utilities/textUtilities.ts b/packages/core/src/shared/utilities/textUtilities.ts index e011247a86..34a0d777bc 100644 --- a/packages/core/src/shared/utilities/textUtilities.ts +++ b/packages/core/src/shared/utilities/textUtilities.ts @@ -395,3 +395,7 @@ export function undefinedIfEmpty(str: string | undefined): string | undefined { return undefined } + +export function decodeBase64(base64Str: string): string { + return Buffer.from(base64Str, 'base64').toString() +} diff --git a/packages/core/src/test/setupUtil.ts b/packages/core/src/test/setupUtil.ts index 6a46514cf0..f158d67ad5 100644 --- a/packages/core/src/test/setupUtil.ts +++ b/packages/core/src/test/setupUtil.ts @@ -11,6 +11,7 @@ import { hasKey } from '../shared/utilities/tsUtils' import { getTestWindow, printPendingUiElements } from './shared/vscode/window' import { ToolkitError, formatError } from '../shared/errors' import { proceedToBrowser } from '../auth/sso/model' +import { decodeBase64 } from '../shared' const runnableTimeout = Symbol('runnableTimeout') @@ -164,7 +165,7 @@ export async function invokeLambda(id: string, request: unknown): Promise Date: Wed, 18 Sep 2024 16:25:51 -0400 Subject: [PATCH 04/11] simple working version --- .../core/src/awsService/ec2/activation.ts | 14 ++++-- .../core/src/awsService/ec2/ec2LogProvider.ts | 49 +++++++++++++++++++ packages/core/src/shared/constants.ts | 1 + 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 packages/core/src/awsService/ec2/ec2LogProvider.ts diff --git a/packages/core/src/awsService/ec2/activation.ts b/packages/core/src/awsService/ec2/activation.ts index 9f4c1f670f..fa171b9da6 100644 --- a/packages/core/src/awsService/ec2/activation.ts +++ b/packages/core/src/awsService/ec2/activation.ts @@ -2,6 +2,7 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ +import * as vscode from 'vscode' import { ExtContext } from '../../shared/extensions' import { Commands } from '../../shared/vscode/commands2' import { telemetry } from '../../shared/telemetry/telemetry' @@ -17,9 +18,13 @@ import { refreshExplorer, } from './commands' import { getLogger } from '../../shared' -import { Ec2Client } from '../../shared/clients/ec2Client' +import { EC2_LOGS_SCHEME } from '../../shared/constants' +import { Ec2LogProvider, formEc2Uri } from './ec2LogProvider' export async function activate(ctx: ExtContext): Promise { + ctx.extensionContext.subscriptions.push( + vscode.workspace.registerTextDocumentContentProvider(EC2_LOGS_SCHEME, new Ec2LogProvider()) + ) ctx.extensionContext.subscriptions.push( Commands.register('aws.ec2.openTerminal', async (node?: Ec2InstanceNode) => { await telemetry.ec2_connectToInstance.run(async (span) => { @@ -33,9 +38,10 @@ export async function activate(ctx: ExtContext): Promise { }), Commands.register('aws.ec2.viewLogs', async (node: Ec2InstanceNode) => { getLogger().info('viewLogs command run from explorer') - const ec2Client = new Ec2Client(node.regionCode) - const rsp = await ec2Client.getConsoleOutput(node.InstanceId, false) - getLogger().info(rsp.Output) + const uri = formEc2Uri(node.toSelection()) + const doc = await vscode.workspace.openTextDocument(uri) + await vscode.window.showTextDocument(doc, { preview: false }) + await vscode.languages.setTextDocumentLanguage(doc, 'log') }), Commands.register('aws.ec2.openRemoteConnection', async (node?: Ec2Node) => { diff --git a/packages/core/src/awsService/ec2/ec2LogProvider.ts b/packages/core/src/awsService/ec2/ec2LogProvider.ts new file mode 100644 index 0000000000..14a55da8d4 --- /dev/null +++ b/packages/core/src/awsService/ec2/ec2LogProvider.ts @@ -0,0 +1,49 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +import * as vscode from 'vscode' +import { Ec2Selection } from './prompter' +import { Ec2Client } from '../../shared/clients/ec2Client' +import { EC2_LOGS_SCHEME } from '../../shared/constants' + +export class Ec2LogProvider implements vscode.TextDocumentContentProvider { + public constructor() {} + + public async provideTextDocumentContent(uri: vscode.Uri): Promise { + if (!isEc2Uri(uri)) { + throw new Error(`Invalid EC2 Logs URI: ${uri}`) + } + const ec2Selection = parseEc2Uri(uri) + const ec2Client = new Ec2Client(ec2Selection.region) + const consoleOutput = await ec2Client.getConsoleOutput(ec2Selection.instanceId, false) + return consoleOutput.Output + } +} + +function parseEc2Uri(uri: vscode.Uri): Ec2Selection { + const parts = uri.path.split(':') + + if (uri.scheme !== EC2_LOGS_SCHEME) { + throw new Error(`URI ${uri} is not parseable for EC2 Logs`) + } + + return { + instanceId: parts[1], + region: parts[0], + } +} + +export function formEc2Uri(selection: Ec2Selection): vscode.Uri { + return vscode.Uri.parse(`${EC2_LOGS_SCHEME}:${selection.region}:${selection.instanceId}`) +} + +/** True if given URI is a valid Ec2 Logs Uri */ +function isEc2Uri(uri: vscode.Uri): boolean { + try { + parseEc2Uri(uri) + return true + } catch { + return false + } +} diff --git a/packages/core/src/shared/constants.ts b/packages/core/src/shared/constants.ts index 1b2d3a5253..6928b71bd1 100644 --- a/packages/core/src/shared/constants.ts +++ b/packages/core/src/shared/constants.ts @@ -112,6 +112,7 @@ export const ecsIamPermissionsUrl = vscode.Uri.parse( */ export const CLOUDWATCH_LOGS_SCHEME = 'aws-cwl' // eslint-disable-line @typescript-eslint/naming-convention export const AWS_SCHEME = 'aws' // eslint-disable-line @typescript-eslint/naming-convention +export const EC2_LOGS_SCHEME = 'aws-ec2' // eslint-disable-next-line @typescript-eslint/naming-convention export const lambdaPackageTypeImage = 'Image' From 0ffbcdd5a49b632dcd7f8f5b0830bb35e0c34933 Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 19 Sep 2024 10:25:25 -0400 Subject: [PATCH 05/11] fix constant file with ignore --- packages/core/src/shared/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/shared/constants.ts b/packages/core/src/shared/constants.ts index 6928b71bd1..8efffcef8b 100644 --- a/packages/core/src/shared/constants.ts +++ b/packages/core/src/shared/constants.ts @@ -112,7 +112,7 @@ export const ecsIamPermissionsUrl = vscode.Uri.parse( */ export const CLOUDWATCH_LOGS_SCHEME = 'aws-cwl' // eslint-disable-line @typescript-eslint/naming-convention export const AWS_SCHEME = 'aws' // eslint-disable-line @typescript-eslint/naming-convention -export const EC2_LOGS_SCHEME = 'aws-ec2' // eslint-disable-next-line @typescript-eslint/naming-convention +export const EC2_LOGS_SCHEME = 'aws-ec2' // eslint-disable-line @typescript-eslint/naming-convention export const lambdaPackageTypeImage = 'Image' From 397b545c4a7d32268c7c7f17c4859e5d001ba4fd Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 19 Sep 2024 10:46:55 -0400 Subject: [PATCH 06/11] add testing for document provider --- .../core/src/awsService/ec2/activation.ts | 4 +- ...gProvider.ts => ec2LogDocumentProvider.ts} | 5 +-- .../ec2/ec2LogDocumentProvider.test.ts | 39 +++++++++++++++++++ 3 files changed, 43 insertions(+), 5 deletions(-) rename packages/core/src/awsService/ec2/{ec2LogProvider.ts => ec2LogDocumentProvider.ts} (87%) create mode 100644 packages/core/src/test/awsService/ec2/ec2LogDocumentProvider.test.ts diff --git a/packages/core/src/awsService/ec2/activation.ts b/packages/core/src/awsService/ec2/activation.ts index fa171b9da6..1e70eec80b 100644 --- a/packages/core/src/awsService/ec2/activation.ts +++ b/packages/core/src/awsService/ec2/activation.ts @@ -19,11 +19,11 @@ import { } from './commands' import { getLogger } from '../../shared' import { EC2_LOGS_SCHEME } from '../../shared/constants' -import { Ec2LogProvider, formEc2Uri } from './ec2LogProvider' +import { Ec2LogDocumentProvider, formEc2Uri } from './ec2LogDocumentProvider' export async function activate(ctx: ExtContext): Promise { ctx.extensionContext.subscriptions.push( - vscode.workspace.registerTextDocumentContentProvider(EC2_LOGS_SCHEME, new Ec2LogProvider()) + vscode.workspace.registerTextDocumentContentProvider(EC2_LOGS_SCHEME, new Ec2LogDocumentProvider()) ) ctx.extensionContext.subscriptions.push( Commands.register('aws.ec2.openTerminal', async (node?: Ec2InstanceNode) => { diff --git a/packages/core/src/awsService/ec2/ec2LogProvider.ts b/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts similarity index 87% rename from packages/core/src/awsService/ec2/ec2LogProvider.ts rename to packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts index 14a55da8d4..8973f8ba2c 100644 --- a/packages/core/src/awsService/ec2/ec2LogProvider.ts +++ b/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts @@ -7,12 +7,12 @@ import { Ec2Selection } from './prompter' import { Ec2Client } from '../../shared/clients/ec2Client' import { EC2_LOGS_SCHEME } from '../../shared/constants' -export class Ec2LogProvider implements vscode.TextDocumentContentProvider { +export class Ec2LogDocumentProvider implements vscode.TextDocumentContentProvider { public constructor() {} public async provideTextDocumentContent(uri: vscode.Uri): Promise { if (!isEc2Uri(uri)) { - throw new Error(`Invalid EC2 Logs URI: ${uri}`) + throw new Error(`Invalid EC2 Logs URI: ${uri.toString()}`) } const ec2Selection = parseEc2Uri(uri) const ec2Client = new Ec2Client(ec2Selection.region) @@ -38,7 +38,6 @@ export function formEc2Uri(selection: Ec2Selection): vscode.Uri { return vscode.Uri.parse(`${EC2_LOGS_SCHEME}:${selection.region}:${selection.instanceId}`) } -/** True if given URI is a valid Ec2 Logs Uri */ function isEc2Uri(uri: vscode.Uri): boolean { try { parseEc2Uri(uri) diff --git a/packages/core/src/test/awsService/ec2/ec2LogDocumentProvider.test.ts b/packages/core/src/test/awsService/ec2/ec2LogDocumentProvider.test.ts new file mode 100644 index 0000000000..d071f6f3a5 --- /dev/null +++ b/packages/core/src/test/awsService/ec2/ec2LogDocumentProvider.test.ts @@ -0,0 +1,39 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import assert from 'assert' +import * as vscode from 'vscode' +import * as sinon from 'sinon' +import { Ec2LogDocumentProvider } from '../../../awsService/ec2/ec2LogDocumentProvider' +import { EC2_LOGS_SCHEME } from '../../../shared/constants' +import { Ec2Client } from '../../../shared/clients/ec2Client' + +describe('LogDataDocumentProvider', async function () { + let provider: Ec2LogDocumentProvider + + before(function () { + provider = new Ec2LogDocumentProvider() + }) + + it('throws error on attempt to get content from other schemes', async function () { + const wrongSchemeUri = vscode.Uri.parse(`ec2-not:us-west1:id`) + + await assert.rejects(async () => await provider.provideTextDocumentContent(wrongSchemeUri), { + message: `Invalid EC2 Logs URI: ${wrongSchemeUri.toString()}`, + }) + }) + + it('fetches content for valid ec2 log URI', async function () { + const validUri = vscode.Uri.parse(`${EC2_LOGS_SCHEME}:us-west1:instance1`) + const expectedContent = 'log content' + sinon.stub(Ec2Client.prototype, 'getConsoleOutput').resolves({ + InstanceId: 'instance1', + Output: expectedContent, + }) + const content = await provider.provideTextDocumentContent(validUri) + assert.strictEqual(content, expectedContent) + sinon.restore() + }) +}) From 6cc7429cfd45a05fe4fd6a2b0eefb3dc09f32214 Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 19 Sep 2024 11:42:42 -0400 Subject: [PATCH 07/11] refactor to use schema --- .../cloudWatchLogs/changeLogSearch.ts | 4 +- .../cloudWatchLogs/cloudWatchLogsUtils.ts | 39 ++++++------------- .../commands/copyLogResource.ts | 4 +- .../commands/saveCurrentLogDataContent.ts | 4 +- .../cloudWatchLogs/commands/searchLogGroup.ts | 6 +-- .../cloudWatchLogs/commands/viewLogStream.ts | 4 +- .../document/logDataDocumentProvider.ts | 4 +- .../document/logStreamsCodeLensProvider.ts | 15 ++++--- .../registry/logDataRegistry.ts | 9 ++++- .../awsService/ec2/ec2LogDocumentProvider.ts | 17 +++----- .../core/src/shared/utilities/uriUtils.ts | 21 ++++++++++ .../commands/copyLogResource.test.ts | 6 +-- .../saveCurrentLogDataContent.test.ts | 4 +- .../document/logDataDocumentProvider.test.ts | 11 ++++-- .../logStreamsCodeLensProvider.test.ts | 4 +- .../registry/logDataRegistry.test.ts | 24 +++++++++--- .../awsService/cloudWatchLogs/utils.test.ts | 25 ++++++------ 17 files changed, 110 insertions(+), 91 deletions(-) diff --git a/packages/core/src/awsService/cloudWatchLogs/changeLogSearch.ts b/packages/core/src/awsService/cloudWatchLogs/changeLogSearch.ts index 4797e06fc0..349f7339e8 100644 --- a/packages/core/src/awsService/cloudWatchLogs/changeLogSearch.ts +++ b/packages/core/src/awsService/cloudWatchLogs/changeLogSearch.ts @@ -5,7 +5,7 @@ import { CancellationError } from '../../shared/utilities/timeoutUtils' import { telemetry } from '../../shared/telemetry/telemetry' import { showInputBox } from '../../shared/ui/inputPrompter' -import { createURIFromArgs, isLogStreamUri, recordTelemetryFilter } from './cloudWatchLogsUtils' +import { cwlUriSchema, isLogStreamUri, recordTelemetryFilter } from './cloudWatchLogsUtils' import { prepareDocument } from './commands/searchLogGroup' import { getActiveDocumentUri } from './document/logDataDocumentProvider' import { CloudWatchLogsData, filterLogEventsFromUri, LogDataRegistry } from './registry/logDataRegistry' @@ -98,7 +98,7 @@ export async function changeLogSearchParams( throw new CancellationError('user') } - const newUri = createURIFromArgs(newData.logGroupInfo, newData.parameters) + const newUri = cwlUriSchema.form({ logGroupInfo: newData.logGroupInfo, parameters: newData.parameters }) await prepareDocument(newUri, newData, registry) }) } diff --git a/packages/core/src/awsService/cloudWatchLogs/cloudWatchLogsUtils.ts b/packages/core/src/awsService/cloudWatchLogs/cloudWatchLogsUtils.ts index b8c769e92f..e235659515 100644 --- a/packages/core/src/awsService/cloudWatchLogs/cloudWatchLogsUtils.ts +++ b/packages/core/src/awsService/cloudWatchLogs/cloudWatchLogsUtils.ts @@ -6,8 +6,9 @@ import { telemetry } from '../../shared/telemetry/telemetry' import * as vscode from 'vscode' import { CLOUDWATCH_LOGS_SCHEME } from '../../shared/constants' import { fromExtensionManifest } from '../../shared/settings' -import { CloudWatchLogsData, CloudWatchLogsGroupInfo } from './registry/logDataRegistry' +import { CloudWatchLogsArgs, CloudWatchLogsData, CloudWatchLogsGroupInfo } from './registry/logDataRegistry' import { CloudWatchLogsParameters } from './registry/logDataRegistry' +import { UriSchema } from '../../shared/utilities/uriUtils' // URIs are the only vehicle for delivering information to a TextDocumentContentProvider. // The following functions are used to structure and destructure relevant information to/from a URI. @@ -32,8 +33,7 @@ export function recordTelemetryFilter(logData: CloudWatchLogsData): void { export function uriToKey(uri: vscode.Uri): string { if (uri.query) { try { - const { filterPattern, startTime, endTime, limit, streamNameOptions } = - parseCloudWatchLogsUri(uri).parameters + const { filterPattern, startTime, endTime, limit, streamNameOptions } = cwlUriSchema.parse(uri).parameters const parts = [uri.path, filterPattern, startTime, endTime, limit, streamNameOptions] return parts.map((p) => p ?? '').join(':') } catch { @@ -52,7 +52,7 @@ export function uriToKey(uri: vscode.Uri): string { * message as the actual log group search. That results in a more fluid UX. */ export function msgKey(logGroupInfo: CloudWatchLogsGroupInfo): string { - const uri = createURIFromArgs(logGroupInfo, {}) + const uri = cwlUriSchema.form({ logGroupInfo: logGroupInfo, parameters: {} }) return uri.toString() } @@ -60,10 +60,7 @@ export function msgKey(logGroupInfo: CloudWatchLogsGroupInfo): string { * Destructures an awsCloudWatchLogs URI into its component pieces. * @param uri URI for a Cloudwatch Logs file */ -export function parseCloudWatchLogsUri(uri: vscode.Uri): { - logGroupInfo: CloudWatchLogsGroupInfo - parameters: CloudWatchLogsParameters -} { +function parseCloudWatchLogsUri(uri: vscode.Uri): CloudWatchLogsArgs { const parts = uri.path.split(':') if (uri.scheme !== CLOUDWATCH_LOGS_SCHEME) { @@ -85,18 +82,8 @@ export function parseCloudWatchLogsUri(uri: vscode.Uri): { } } -/** True if given URI is a valid Cloud Watch Logs Uri */ -export function isCwlUri(uri: vscode.Uri): boolean { - try { - parseCloudWatchLogsUri(uri) - return true - } catch { - return false - } -} - export function patternFromCwlUri(uri: vscode.Uri): CloudWatchLogsParameters['filterPattern'] { - return parseCloudWatchLogsUri(uri).parameters.filterPattern + return cwlUriSchema.parse(uri).parameters.filterPattern } /** @@ -105,7 +92,7 @@ export function patternFromCwlUri(uri: vscode.Uri): CloudWatchLogsParameters['fi * @returns */ export function isLogStreamUri(uri: vscode.Uri): boolean { - const logGroupInfo = parseCloudWatchLogsUri(uri).logGroupInfo + const logGroupInfo = cwlUriSchema.parse(uri).logGroupInfo return logGroupInfo.streamName !== undefined } @@ -115,15 +102,13 @@ export function isLogStreamUri(uri: vscode.Uri): boolean { * @param streamName Log stream name * @param regionName AWS region */ -export function createURIFromArgs( - logGroupInfo: CloudWatchLogsGroupInfo, - parameters: CloudWatchLogsParameters -): vscode.Uri { - let uriStr = `${CLOUDWATCH_LOGS_SCHEME}:${logGroupInfo.regionName}:${logGroupInfo.groupName}` - uriStr += logGroupInfo.streamName ? `:${logGroupInfo.streamName}` : '' +function createURIFromArgs(args: CloudWatchLogsArgs): vscode.Uri { + let uriStr = `${CLOUDWATCH_LOGS_SCHEME}:${args.logGroupInfo.regionName}:${args.logGroupInfo.groupName}` + uriStr += args.logGroupInfo.streamName ? `:${args.logGroupInfo.streamName}` : '' - uriStr += `?${encodeURIComponent(JSON.stringify(parameters))}` + uriStr += `?${encodeURIComponent(JSON.stringify(args.parameters))}` return vscode.Uri.parse(uriStr) } +export const cwlUriSchema = new UriSchema(parseCloudWatchLogsUri, createURIFromArgs) export class CloudWatchLogsSettings extends fromExtensionManifest('aws.cwl', { limit: Number }) {} diff --git a/packages/core/src/awsService/cloudWatchLogs/commands/copyLogResource.ts b/packages/core/src/awsService/cloudWatchLogs/commands/copyLogResource.ts index b7cca40c75..846f87e797 100644 --- a/packages/core/src/awsService/cloudWatchLogs/commands/copyLogResource.ts +++ b/packages/core/src/awsService/cloudWatchLogs/commands/copyLogResource.ts @@ -7,7 +7,7 @@ import * as nls from 'vscode-nls' const localize = nls.loadMessageBundle() import * as vscode from 'vscode' -import { isLogStreamUri, parseCloudWatchLogsUri } from '../cloudWatchLogsUtils' +import { cwlUriSchema, isLogStreamUri } from '../cloudWatchLogsUtils' import { copyToClipboard } from '../../../shared/utilities/messages' export async function copyLogResource(uri?: vscode.Uri): Promise { @@ -20,7 +20,7 @@ export async function copyLogResource(uri?: vscode.Uri): Promise { throw new Error('no active text editor, or undefined URI') } } - const parsedUri = parseCloudWatchLogsUri(uri) + const parsedUri = cwlUriSchema.parse(uri) const resourceName = isLogStreamUri(uri) ? parsedUri.logGroupInfo.streamName : parsedUri.logGroupInfo.groupName if (!resourceName) { diff --git a/packages/core/src/awsService/cloudWatchLogs/commands/saveCurrentLogDataContent.ts b/packages/core/src/awsService/cloudWatchLogs/commands/saveCurrentLogDataContent.ts index 2e83e04cf7..9d1600fafb 100644 --- a/packages/core/src/awsService/cloudWatchLogs/commands/saveCurrentLogDataContent.ts +++ b/packages/core/src/awsService/cloudWatchLogs/commands/saveCurrentLogDataContent.ts @@ -7,7 +7,7 @@ import * as vscode from 'vscode' import * as nls from 'vscode-nls' const localize = nls.loadMessageBundle() -import { isLogStreamUri, parseCloudWatchLogsUri } from '../cloudWatchLogsUtils' +import { cwlUriSchema, isLogStreamUri } from '../cloudWatchLogsUtils' import { telemetry, CloudWatchResourceType, Result } from '../../../shared/telemetry/telemetry' import fs from '../../../shared/fs/fs' @@ -28,7 +28,7 @@ export async function saveCurrentLogDataContent(): Promise { const workspaceDir = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].uri : vscode.Uri.file(fs.getUserHomeDir()) - const uriComponents = parseCloudWatchLogsUri(uri) + const uriComponents = cwlUriSchema.parse(uri) const logGroupInfo = uriComponents.logGroupInfo const localizedLogFile = localize('AWS.command.saveCurrentLogDataContent.logfile', 'Log File') diff --git a/packages/core/src/awsService/cloudWatchLogs/commands/searchLogGroup.ts b/packages/core/src/awsService/cloudWatchLogs/commands/searchLogGroup.ts index 0dfc491bbb..fca77f85db 100644 --- a/packages/core/src/awsService/cloudWatchLogs/commands/searchLogGroup.ts +++ b/packages/core/src/awsService/cloudWatchLogs/commands/searchLogGroup.ts @@ -16,7 +16,7 @@ import { } from '../registry/logDataRegistry' import { DataQuickPickItem } from '../../../shared/ui/pickerPrompter' import { isValidResponse, isWizardControl, Wizard, WIZARD_RETRY } from '../../../shared/wizards/wizard' -import { createURIFromArgs, msgKey, parseCloudWatchLogsUri, recordTelemetryFilter } from '../cloudWatchLogsUtils' +import { cwlUriSchema, msgKey, recordTelemetryFilter } from '../cloudWatchLogsUtils' import { DefaultCloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogsClient' import { CancellationError } from '../../../shared/utilities/timeoutUtils' import { getLogger } from '../../../shared/logger' @@ -78,7 +78,7 @@ export async function prepareDocument(uri: vscode.Uri, logData: CloudWatchLogsDa localize( 'AWS.cwl.searchLogGroup.errorRetrievingLogs', 'Failed to get logs for {0}', - parseCloudWatchLogsUri(uri).logGroupInfo.groupName + cwlUriSchema.parse(uri).logGroupInfo.groupName ) ) } @@ -105,7 +105,7 @@ export async function searchLogGroup( } const userResponse = handleWizardResponse(response, registry) - const uri = createURIFromArgs(userResponse.logGroupInfo, userResponse.parameters) + const uri = cwlUriSchema.form({ logGroupInfo: userResponse.logGroupInfo, parameters: userResponse.parameters }) await prepareDocument(uri, userResponse, registry) }) } diff --git a/packages/core/src/awsService/cloudWatchLogs/commands/viewLogStream.ts b/packages/core/src/awsService/cloudWatchLogs/commands/viewLogStream.ts index a8ba6dbba7..2bfafd6d2d 100644 --- a/packages/core/src/awsService/cloudWatchLogs/commands/viewLogStream.ts +++ b/packages/core/src/awsService/cloudWatchLogs/commands/viewLogStream.ts @@ -21,11 +21,11 @@ import { initLogData as initLogData, filterLogEventsFromUri, } from '../registry/logDataRegistry' -import { createURIFromArgs } from '../cloudWatchLogsUtils' import { prepareDocument, searchLogGroup } from './searchLogGroup' import { telemetry, Result } from '../../../shared/telemetry/telemetry' import { CancellationError } from '../../../shared/utilities/timeoutUtils' import { formatLocalized } from '../../../shared/utilities/textUtilities' +import { cwlUriSchema } from '../cloudWatchLogsUtils' export async function viewLogStream(node: LogGroupNode, registry: LogDataRegistry): Promise { await telemetry.cloudwatchlogs_open.run(async (span) => { @@ -52,7 +52,7 @@ export async function viewLogStream(node: LogGroupNode, registry: LogDataRegistr limit: registry.configuration.get('limit', 10000), } - const uri = createURIFromArgs(logGroupInfo, parameters) + const uri = cwlUriSchema.form({ logGroupInfo: logGroupInfo, parameters: parameters }) const logData = initLogData(logGroupInfo, parameters, filterLogEventsFromUri) await prepareDocument(uri, logData, registry) }) diff --git a/packages/core/src/awsService/cloudWatchLogs/document/logDataDocumentProvider.ts b/packages/core/src/awsService/cloudWatchLogs/document/logDataDocumentProvider.ts index 8eb390f776..5925911893 100644 --- a/packages/core/src/awsService/cloudWatchLogs/document/logDataDocumentProvider.ts +++ b/packages/core/src/awsService/cloudWatchLogs/document/logDataDocumentProvider.ts @@ -5,8 +5,8 @@ import * as vscode from 'vscode' import { CloudWatchLogsGroupInfo, LogDataRegistry, UriString } from '../registry/logDataRegistry' import { getLogger } from '../../../shared/logger' -import { isCwlUri } from '../cloudWatchLogsUtils' import { generateTextFromLogEvents, LineToLogStreamMap } from './textContent' +import { cwlUriSchema } from '../cloudWatchLogsUtils' export class LogDataDocumentProvider implements vscode.TextDocumentContentProvider { /** Resolves the correct {@link LineToLogStreamMap} instance for a given URI */ @@ -26,7 +26,7 @@ export class LogDataDocumentProvider implements vscode.TextDocumentContentProvid } public provideTextDocumentContent(uri: vscode.Uri): string { - if (!isCwlUri(uri)) { + if (!cwlUriSchema.isValid(uri)) { throw new Error(`Uri is not a CWL Uri, so no text can be provided: ${uri.toString()}`) } const events = this.registry.fetchCachedLogEvents(uri) diff --git a/packages/core/src/awsService/cloudWatchLogs/document/logStreamsCodeLensProvider.ts b/packages/core/src/awsService/cloudWatchLogs/document/logStreamsCodeLensProvider.ts index 5c83ab929d..9870ff009d 100644 --- a/packages/core/src/awsService/cloudWatchLogs/document/logStreamsCodeLensProvider.ts +++ b/packages/core/src/awsService/cloudWatchLogs/document/logStreamsCodeLensProvider.ts @@ -6,12 +6,7 @@ import * as vscode from 'vscode' import { CLOUDWATCH_LOGS_SCHEME } from '../../../shared/constants' import { CloudWatchLogsGroupInfo, LogDataRegistry } from '../registry/logDataRegistry' -import { - CloudWatchLogsSettings, - createURIFromArgs, - isLogStreamUri, - parseCloudWatchLogsUri, -} from '../cloudWatchLogsUtils' +import { CloudWatchLogsSettings, cwlUriSchema, isLogStreamUri } from '../cloudWatchLogsUtils' import { LogDataDocumentProvider } from './logDataDocumentProvider' type IdWithLine = { streamId: string; lineNum: number } @@ -43,7 +38,7 @@ export class LogStreamCodeLensProvider implements vscode.CodeLensProvider { return [] } - const logGroupInfo = parseCloudWatchLogsUri(uri).logGroupInfo + const logGroupInfo = cwlUriSchema.parse(uri).logGroupInfo if (logGroupInfo.streamName) { // This means we have a stream file not a log search. @@ -64,7 +59,11 @@ export class LogStreamCodeLensProvider implements vscode.CodeLensProvider { createLogStreamCodeLens(logGroupInfo: CloudWatchLogsGroupInfo, idWithLine: IdWithLine): vscode.CodeLens { const settings = new CloudWatchLogsSettings() const limit = settings.get('limit', 1000) - const streamUri = createURIFromArgs({ ...logGroupInfo, streamName: idWithLine.streamId }, { limit: limit }) + const cwlArgs = { + logGroupInfo: { ...logGroupInfo, streamName: idWithLine.streamId }, + parameters: { limit: limit }, + } + const streamUri = cwlUriSchema.form(cwlArgs) const cmd: vscode.Command = { command: 'aws.loadLogStreamFile', arguments: [streamUri, this.registry], diff --git a/packages/core/src/awsService/cloudWatchLogs/registry/logDataRegistry.ts b/packages/core/src/awsService/cloudWatchLogs/registry/logDataRegistry.ts index e8ae51558e..88945d61bd 100644 --- a/packages/core/src/awsService/cloudWatchLogs/registry/logDataRegistry.ts +++ b/packages/core/src/awsService/cloudWatchLogs/registry/logDataRegistry.ts @@ -5,7 +5,7 @@ import * as vscode from 'vscode' import { CloudWatchLogs } from 'aws-sdk' -import { CloudWatchLogsSettings, parseCloudWatchLogsUri, uriToKey, msgKey } from '../cloudWatchLogsUtils' +import { CloudWatchLogsSettings, uriToKey, msgKey, cwlUriSchema } from '../cloudWatchLogsUtils' import { DefaultCloudWatchLogsClient } from '../../../shared/clients/cloudWatchLogsClient' import { waitTimeout } from '../../../shared/utilities/timeoutUtils' import { Messages } from '../../../shared/utilities/messages' @@ -190,7 +190,7 @@ export class LogDataRegistry { if (this.isRegistered(uri)) { throw new Error(`Already registered: ${uri.toString()}`) } - const data = parseCloudWatchLogsUri(uri) + const data = cwlUriSchema.parse(uri) this.setLogData(uri, initLogData(data.logGroupInfo, data.parameters, retrieveLogsFunction)) } @@ -281,6 +281,11 @@ export function initLogData( } } +export type CloudWatchLogsArgs = { + logGroupInfo: CloudWatchLogsGroupInfo + parameters: CloudWatchLogsParameters +} + export type CloudWatchLogsGroupInfo = { groupName: string regionName: string diff --git a/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts b/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts index 8973f8ba2c..183964e668 100644 --- a/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts +++ b/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts @@ -6,12 +6,16 @@ import * as vscode from 'vscode' import { Ec2Selection } from './prompter' import { Ec2Client } from '../../shared/clients/ec2Client' import { EC2_LOGS_SCHEME } from '../../shared/constants' +import { UriSchema } from '../../shared/utilities/uriUtils' export class Ec2LogDocumentProvider implements vscode.TextDocumentContentProvider { - public constructor() {} + private Ec2LogSchema: UriSchema + public constructor() { + this.Ec2LogSchema = new UriSchema(parseEc2Uri, formEc2Uri) + } public async provideTextDocumentContent(uri: vscode.Uri): Promise { - if (!isEc2Uri(uri)) { + if (!this.Ec2LogSchema.isValid(uri)) { throw new Error(`Invalid EC2 Logs URI: ${uri.toString()}`) } const ec2Selection = parseEc2Uri(uri) @@ -37,12 +41,3 @@ function parseEc2Uri(uri: vscode.Uri): Ec2Selection { export function formEc2Uri(selection: Ec2Selection): vscode.Uri { return vscode.Uri.parse(`${EC2_LOGS_SCHEME}:${selection.region}:${selection.instanceId}`) } - -function isEc2Uri(uri: vscode.Uri): boolean { - try { - parseEc2Uri(uri) - return true - } catch { - return false - } -} diff --git a/packages/core/src/shared/utilities/uriUtils.ts b/packages/core/src/shared/utilities/uriUtils.ts index 5bd0c8a7f5..3798e96311 100644 --- a/packages/core/src/shared/utilities/uriUtils.ts +++ b/packages/core/src/shared/utilities/uriUtils.ts @@ -25,3 +25,24 @@ export function fromQueryToParameters(query: vscode.Uri['query']): Map { + public constructor( + public parse: (uri: vscode.Uri) => T, + public form: (obj: T) => vscode.Uri + ) {} + + public isValid(uri: vscode.Uri): boolean { + try { + this.parse(uri) + return true + } catch (e) { + return false + } + } +} diff --git a/packages/core/src/test/awsService/cloudWatchLogs/commands/copyLogResource.test.ts b/packages/core/src/test/awsService/cloudWatchLogs/commands/copyLogResource.test.ts index 1405fb7e61..3dc329c8c3 100644 --- a/packages/core/src/test/awsService/cloudWatchLogs/commands/copyLogResource.test.ts +++ b/packages/core/src/test/awsService/cloudWatchLogs/commands/copyLogResource.test.ts @@ -5,8 +5,8 @@ import assert from 'assert' import * as vscode from 'vscode' -import { createURIFromArgs } from '../../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' import { copyLogResource } from '../../../../awsService/cloudWatchLogs/commands/copyLogResource' +import { cwlUriSchema } from '../../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' describe('copyLogResource', async function () { beforeEach(async function () { @@ -23,7 +23,7 @@ describe('copyLogResource', async function () { regionName: 'region', streamName: 'stream', } - const uri = createURIFromArgs(logGroupWithStream, {}) + const uri = cwlUriSchema.form({ logGroupInfo: logGroupWithStream, parameters: {} }) await copyLogResource(uri) @@ -35,7 +35,7 @@ describe('copyLogResource', async function () { groupName: 'group2', regionName: 'region2', } - const uri = createURIFromArgs(logGroup, {}) + const uri = cwlUriSchema.form({ logGroupInfo: logGroup, parameters: {} }) await copyLogResource(uri) diff --git a/packages/core/src/test/awsService/cloudWatchLogs/commands/saveCurrentLogDataContent.test.ts b/packages/core/src/test/awsService/cloudWatchLogs/commands/saveCurrentLogDataContent.test.ts index 74aa135385..b6d1794d86 100644 --- a/packages/core/src/test/awsService/cloudWatchLogs/commands/saveCurrentLogDataContent.test.ts +++ b/packages/core/src/test/awsService/cloudWatchLogs/commands/saveCurrentLogDataContent.test.ts @@ -8,7 +8,6 @@ import * as path from 'path' import * as vscode from 'vscode' import * as fs from 'fs-extra' -import { createURIFromArgs } from '../../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' import { saveCurrentLogDataContent } from '../../../../awsService/cloudWatchLogs/commands/saveCurrentLogDataContent' import { fileExists, makeTemporaryToolkitFolder, readFileAsString } from '../../../../shared/filesystemUtilities' import { getTestWindow } from '../../../shared/vscode/window' @@ -19,6 +18,7 @@ import { LogDataRegistry, } from '../../../../awsService/cloudWatchLogs/registry/logDataRegistry' import { assertTextEditorContains } from '../../../testUtil' +import { cwlUriSchema } from '../../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' async function testFilterLogEvents( logGroupInfo: CloudWatchLogsGroupInfo, @@ -55,7 +55,7 @@ describe('saveCurrentLogDataContent', async function () { regionName: 'r', streamName: 's', } - const uri = createURIFromArgs(logGroupInfo, {}) + const uri = cwlUriSchema.form({ logGroupInfo: logGroupInfo, parameters: {} }) LogDataRegistry.instance.registerInitialLog(uri, testFilterLogEvents) await LogDataRegistry.instance.fetchNextLogEvents(uri) await vscode.window.showTextDocument(uri) diff --git a/packages/core/src/test/awsService/cloudWatchLogs/document/logDataDocumentProvider.test.ts b/packages/core/src/test/awsService/cloudWatchLogs/document/logDataDocumentProvider.test.ts index 703d1f59cb..221d0a6fee 100644 --- a/packages/core/src/test/awsService/cloudWatchLogs/document/logDataDocumentProvider.test.ts +++ b/packages/core/src/test/awsService/cloudWatchLogs/document/logDataDocumentProvider.test.ts @@ -7,7 +7,7 @@ import assert from 'assert' import * as vscode from 'vscode' import { CloudWatchLogsSettings, - createURIFromArgs, + cwlUriSchema, isLogStreamUri, } from '../../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' import { LogDataDocumentProvider } from '../../../../awsService/cloudWatchLogs/document/logDataDocumentProvider' @@ -64,7 +64,7 @@ describe('LogDataDocumentProvider', async function () { regionName: 'region', streamName: 'stream', } - const getLogsUri = createURIFromArgs(getLogsLogGroupInfo, {}) + const getLogsUri = cwlUriSchema.form({ logGroupInfo: getLogsLogGroupInfo, parameters: {} }) const filterLogsStream: CloudWatchLogsData = { events: [], @@ -77,7 +77,10 @@ describe('LogDataDocumentProvider', async function () { busy: false, } - const filterLogsUri = createURIFromArgs(filterLogsStream.logGroupInfo, filterLogsStream.parameters) + const filterLogsUri = cwlUriSchema.form({ + logGroupInfo: filterLogsStream.logGroupInfo, + parameters: filterLogsStream.parameters, + }) before(function () { config = new Settings(vscode.ConfigurationTarget.Workspace) @@ -130,7 +133,7 @@ describe('LogDataDocumentProvider', async function () { regionName: 'regionA', streamName: 'streamA', } - const logStreamNameUri = createURIFromArgs(logGroupInfo, {}) + const logStreamNameUri = cwlUriSchema.form({ logGroupInfo: logGroupInfo, parameters: {} }) const events: FilteredLogEvent[] = [ { diff --git a/packages/core/src/test/awsService/cloudWatchLogs/document/logStreamsCodeLensProvider.test.ts b/packages/core/src/test/awsService/cloudWatchLogs/document/logStreamsCodeLensProvider.test.ts index 52ab01b30b..ae222fd25d 100644 --- a/packages/core/src/test/awsService/cloudWatchLogs/document/logStreamsCodeLensProvider.test.ts +++ b/packages/core/src/test/awsService/cloudWatchLogs/document/logStreamsCodeLensProvider.test.ts @@ -9,8 +9,8 @@ import { LogDataRegistry } from '../../../../awsService/cloudWatchLogs/registry/ import { LogDataDocumentProvider } from '../../../../awsService/cloudWatchLogs/document/logDataDocumentProvider' import { CancellationToken, CodeLens, TextDocument } from 'vscode' import assert = require('assert') -import { createURIFromArgs } from '../../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' import { createStubInstance, SinonStubbedInstance } from 'sinon' +import { cwlUriSchema } from '../../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' describe('LogStreamCodeLensProvider', async () => { describe('provideCodeLenses()', async () => { @@ -18,7 +18,7 @@ describe('LogStreamCodeLensProvider', async () => { let documentProvider: SinonStubbedInstance const logGroupInfo = { groupName: 'MyGroupName', regionName: 'MyRegionName' } - const logUri = createURIFromArgs(logGroupInfo, {}) + const logUri = cwlUriSchema.form({ logGroupInfo: logGroupInfo, parameters: {} }) before(async () => { const registry: LogDataRegistry = {} as LogDataRegistry diff --git a/packages/core/src/test/awsService/cloudWatchLogs/registry/logDataRegistry.test.ts b/packages/core/src/test/awsService/cloudWatchLogs/registry/logDataRegistry.test.ts index 108b6843b8..f9b253d941 100644 --- a/packages/core/src/test/awsService/cloudWatchLogs/registry/logDataRegistry.test.ts +++ b/packages/core/src/test/awsService/cloudWatchLogs/registry/logDataRegistry.test.ts @@ -14,7 +14,7 @@ import { CloudWatchLogsData, } from '../../../../awsService/cloudWatchLogs/registry/logDataRegistry' import { Settings } from '../../../../shared/settings' -import { CloudWatchLogsSettings, createURIFromArgs } from '../../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' +import { CloudWatchLogsSettings, cwlUriSchema } from '../../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' import { backwardToken, fakeGetLogEvents, @@ -34,11 +34,23 @@ describe('LogDataRegistry', async function () { const config = new Settings(vscode.ConfigurationTarget.Workspace) - const registeredUri = createURIFromArgs(testLogData.logGroupInfo, testLogData.parameters) - const unregisteredUri = createURIFromArgs(unregisteredData.logGroupInfo, unregisteredData.parameters) - const newLineUri = createURIFromArgs(newLineData.logGroupInfo, newLineData.parameters) - const searchLogGroupUri = createURIFromArgs(logGroupsData.logGroupInfo, logGroupsData.parameters) - const paginatedUri = createURIFromArgs(paginatedData.logGroupInfo, paginatedData.parameters) + const registeredUri = cwlUriSchema.form({ + logGroupInfo: testLogData.logGroupInfo, + parameters: testLogData.parameters, + }) + const unregisteredUri = cwlUriSchema.form({ + logGroupInfo: unregisteredData.logGroupInfo, + parameters: unregisteredData.parameters, + }) + const newLineUri = cwlUriSchema.form({ logGroupInfo: newLineData.logGroupInfo, parameters: newLineData.parameters }) + const searchLogGroupUri = cwlUriSchema.form({ + logGroupInfo: logGroupsData.logGroupInfo, + parameters: logGroupsData.parameters, + }) + const paginatedUri = cwlUriSchema.form({ + logGroupInfo: paginatedData.logGroupInfo, + parameters: paginatedData.parameters, + }) /** * Only intended to expose the {get|set}LogData methods for testing purposes. diff --git a/packages/core/src/test/awsService/cloudWatchLogs/utils.test.ts b/packages/core/src/test/awsService/cloudWatchLogs/utils.test.ts index eed2b709c4..02a768c4f0 100644 --- a/packages/core/src/test/awsService/cloudWatchLogs/utils.test.ts +++ b/packages/core/src/test/awsService/cloudWatchLogs/utils.test.ts @@ -6,11 +6,7 @@ import assert from 'assert' import { CloudWatchLogs } from 'aws-sdk' import * as vscode from 'vscode' -import { - createURIFromArgs, - parseCloudWatchLogsUri, - uriToKey, -} from '../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' +import { cwlUriSchema, uriToKey } from '../../../awsService/cloudWatchLogs/cloudWatchLogsUtils' import { CloudWatchLogsParameters, CloudWatchLogsData, @@ -170,28 +166,31 @@ export const paginatedData: CloudWatchLogsData = { retrieveLogsFunction: returnPaginatedEvents, busy: false, } -export const goodUri = createURIFromArgs(testComponents.logGroupInfo, testComponents.parameters) +export const goodUri = cwlUriSchema.form({ + logGroupInfo: testComponents.logGroupInfo, + parameters: testComponents.parameters, +}) describe('parseCloudWatchLogsUri', async function () { it('converts a valid URI to components', function () { - const result = parseCloudWatchLogsUri(goodUri) + const result = cwlUriSchema.parse(goodUri) assert.deepStrictEqual(result.logGroupInfo, testComponents.logGroupInfo) assert.deepStrictEqual(result.parameters, testComponents.parameters) }) it('does not convert URIs with an invalid scheme', async function () { assert.throws(() => { - parseCloudWatchLogsUri(vscode.Uri.parse('wrong:scheme')) + cwlUriSchema.parse(vscode.Uri.parse('wrong:scheme')) }) }) it('does not convert URIs with more or less than three elements', async function () { assert.throws(() => { - parseCloudWatchLogsUri(vscode.Uri.parse(`${CLOUDWATCH_LOGS_SCHEME}:elementOne:elementTwo`)) + cwlUriSchema.parse(vscode.Uri.parse(`${CLOUDWATCH_LOGS_SCHEME}:elementOne:elementTwo`)) }) assert.throws(() => { - parseCloudWatchLogsUri( + cwlUriSchema.parse( vscode.Uri.parse(`${CLOUDWATCH_LOGS_SCHEME}:elementOne:elementTwo:elementThree:whoopsAllElements`) ) }) @@ -208,7 +207,7 @@ describe('createURIFromArgs', function () { )}` ) assert.deepStrictEqual(testUri, goodUri) - const newTestComponents = parseCloudWatchLogsUri(testUri) + const newTestComponents = cwlUriSchema.parse(testUri) assert.deepStrictEqual(testComponents, newTestComponents) }) }) @@ -230,8 +229,8 @@ describe('uriToKey', function () { it('creates the same key for different order query', function () { const param1: CloudWatchLogsParameters = { filterPattern: 'same', startTime: 0 } const param2: CloudWatchLogsParameters = { startTime: 0, filterPattern: 'same' } - const firstOrder = createURIFromArgs(testComponents.logGroupInfo, param1) - const secondOrder = createURIFromArgs(testComponents.logGroupInfo, param2) + const firstOrder = cwlUriSchema.form({ logGroupInfo: testComponents.logGroupInfo, parameters: param1 }) + const secondOrder = cwlUriSchema.form({ logGroupInfo: testComponents.logGroupInfo, parameters: param2 }) assert.notDeepStrictEqual(firstOrder, secondOrder) assert.strictEqual(uriToKey(firstOrder), uriToKey(secondOrder)) From 66bd1dfd0b26e65d80493467481eaf7d06b5284a Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 19 Sep 2024 11:52:02 -0400 Subject: [PATCH 08/11] clean up ec2 use of schema --- packages/core/src/awsService/ec2/activation.ts | 10 +++------- packages/core/src/awsService/ec2/commands.ts | 10 +++++++++- .../src/awsService/ec2/ec2LogDocumentProvider.ts | 13 ++++++------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/packages/core/src/awsService/ec2/activation.ts b/packages/core/src/awsService/ec2/activation.ts index 1e70eec80b..25dd6d8fdb 100644 --- a/packages/core/src/awsService/ec2/activation.ts +++ b/packages/core/src/awsService/ec2/activation.ts @@ -16,10 +16,10 @@ import { startInstance, stopInstance, refreshExplorer, + openLogDocument, } from './commands' -import { getLogger } from '../../shared' import { EC2_LOGS_SCHEME } from '../../shared/constants' -import { Ec2LogDocumentProvider, formEc2Uri } from './ec2LogDocumentProvider' +import { Ec2LogDocumentProvider } from './ec2LogDocumentProvider' export async function activate(ctx: ExtContext): Promise { ctx.extensionContext.subscriptions.push( @@ -37,11 +37,7 @@ export async function activate(ctx: ExtContext): Promise { await copyTextCommand(node, 'id') }), Commands.register('aws.ec2.viewLogs', async (node: Ec2InstanceNode) => { - getLogger().info('viewLogs command run from explorer') - const uri = formEc2Uri(node.toSelection()) - const doc = await vscode.workspace.openTextDocument(uri) - await vscode.window.showTextDocument(doc, { preview: false }) - await vscode.languages.setTextDocumentLanguage(doc, 'log') + await openLogDocument(node) }), Commands.register('aws.ec2.openRemoteConnection', async (node?: Ec2Node) => { diff --git a/packages/core/src/awsService/ec2/commands.ts b/packages/core/src/awsService/ec2/commands.ts index aaf853f350..a1b30cdff7 100644 --- a/packages/core/src/awsService/ec2/commands.ts +++ b/packages/core/src/awsService/ec2/commands.ts @@ -2,7 +2,7 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - +import * as vscode from 'vscode' import { Ec2InstanceNode } from './explorer/ec2InstanceNode' import { Ec2Node } from './explorer/ec2ParentNode' import { Ec2ConnectionManager } from './model' @@ -10,6 +10,7 @@ import { Ec2Prompter, instanceFilter, Ec2Selection } from './prompter' import { SafeEc2Instance, Ec2Client } from '../../shared/clients/ec2Client' import { copyToClipboard } from '../../shared/utilities/messages' import { getLogger } from '../../shared/logger' +import { ec2LogSchema } from './ec2LogDocumentProvider' export function refreshExplorer(node?: Ec2Node) { if (node) { @@ -62,3 +63,10 @@ async function getSelection(node?: Ec2Node, filter?: instanceFilter): Promise { await copyToClipboard(instanceId, 'Id') } + +export async function openLogDocument(node: Ec2InstanceNode): Promise { + const uri = ec2LogSchema.form(node.toSelection()) + const doc = await vscode.workspace.openTextDocument(uri) + await vscode.window.showTextDocument(doc, { preview: false }) + await vscode.languages.setTextDocumentLanguage(doc, 'log') +} diff --git a/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts b/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts index 183964e668..68ef2ecf6b 100644 --- a/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts +++ b/packages/core/src/awsService/ec2/ec2LogDocumentProvider.ts @@ -9,22 +9,21 @@ import { EC2_LOGS_SCHEME } from '../../shared/constants' import { UriSchema } from '../../shared/utilities/uriUtils' export class Ec2LogDocumentProvider implements vscode.TextDocumentContentProvider { - private Ec2LogSchema: UriSchema - public constructor() { - this.Ec2LogSchema = new UriSchema(parseEc2Uri, formEc2Uri) - } + public constructor() {} public async provideTextDocumentContent(uri: vscode.Uri): Promise { - if (!this.Ec2LogSchema.isValid(uri)) { + if (!ec2LogSchema.isValid(uri)) { throw new Error(`Invalid EC2 Logs URI: ${uri.toString()}`) } - const ec2Selection = parseEc2Uri(uri) + const ec2Selection = ec2LogSchema.parse(uri) const ec2Client = new Ec2Client(ec2Selection.region) const consoleOutput = await ec2Client.getConsoleOutput(ec2Selection.instanceId, false) return consoleOutput.Output } } +export const ec2LogSchema = new UriSchema(parseEc2Uri, formEc2Uri) + function parseEc2Uri(uri: vscode.Uri): Ec2Selection { const parts = uri.path.split(':') @@ -38,6 +37,6 @@ function parseEc2Uri(uri: vscode.Uri): Ec2Selection { } } -export function formEc2Uri(selection: Ec2Selection): vscode.Uri { +function formEc2Uri(selection: Ec2Selection): vscode.Uri { return vscode.Uri.parse(`${EC2_LOGS_SCHEME}:${selection.region}:${selection.instanceId}`) } From 8e562f13f65060145d8d3f3926b822bd4fa747b2 Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 19 Sep 2024 12:11:30 -0400 Subject: [PATCH 09/11] update on-click text --- packages/core/package.nls.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.nls.json b/packages/core/package.nls.json index 2a2e2ae31d..54a143bdfe 100644 --- a/packages/core/package.nls.json +++ b/packages/core/package.nls.json @@ -127,7 +127,7 @@ "AWS.command.ec2.stopInstance": "Stop EC2 Instance", "AWS.command.ec2.rebootInstance": "Reboot EC2 Instance", "AWS.command.ec2.copyInstanceId": "Copy Instance Id", - "AWS.command.ec2.viewLogs": "View system logs", + "AWS.command.ec2.viewLogs": "View Current System Logs", "AWS.command.ecr.copyTagUri": "Copy Tag URI", "AWS.command.ecr.copyRepositoryUri": "Copy Repository URI", "AWS.command.ecr.createRepository": "Create Repository...", From 99d8e7b6f7ef81efafa5aba79ee657f7ef90279f Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 19 Sep 2024 12:13:23 -0400 Subject: [PATCH 10/11] reset package.json --- packages/toolkit/package.json | 3086 +-------------------------------- 1 file changed, 54 insertions(+), 3032 deletions(-) diff --git a/packages/toolkit/package.json b/packages/toolkit/package.json index bf52f062cc..ecdae4246b 100644 --- a/packages/toolkit/package.json +++ b/packages/toolkit/package.json @@ -51,10 +51,7 @@ ], "main": "./dist/src/extensionNode", "browser": "./dist/src/extensionWeb", - "engines": { - "npm": "^10.1.0", - "vscode": "^1.68.0" - }, + "engines": "This field will be autopopulated from the core module during debugging and packaging.", "scripts": { "vscode:prepublish": "npm run clean && npm run buildScripts && webpack --mode production", "buildScripts": "npm run generateNonCodeFiles && npm run copyFiles && npm run generateIcons && npm run generateSettings && npm run generateConfigurationAttributes && tsc -p ./ --noEmit", @@ -677,3016 +674,68 @@ ] } ], - "viewsContainers": { - "activitybar": [ - { - "id": "aws-explorer", - "title": "%AWS.title%", - "icon": "resources/aws-logo.svg", - "cloud9": { - "cn": { - "title": "%AWS.title.cn%", - "icon": "resources/aws-cn-logo.svg" - } - } + "icons": { + "aws-amazonq-q-gradient": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1aa" } - ] - }, - "views": { - "aws-explorer": [ - { - "id": "aws.amazonq.codewhisperer", - "name": "%AWS.amazonq.codewhisperer.title%", - "when": "!isCloud9 && !aws.isSageMaker && !aws.toolkit.amazonq.dismissed && !aws.explorer.showAuthView" - }, - { - "id": "aws.explorer", - "name": "%AWS.lambda.explorerTitle%", - "when": "(isCloud9 || !aws.isWebExtHost) && !aws.explorer.showAuthView" - }, - { - "id": "aws.cdk", - "name": "%AWS.cdk.explorerTitle%", - "when": "!aws.explorer.showAuthView" - }, - { - "id": "aws.codecatalyst", - "name": "%AWS.codecatalyst.explorerTitle%", - "when": "(!isCloud9 && !aws.isSageMaker || isCloud9CodeCatalyst) && !aws.explorer.showAuthView" - }, - { - "type": "webview", - "id": "aws.toolkit.AmazonCommonAuth", - "name": "%AWS.amazonq.login%", - "when": "!isCloud9 && !aws.isSageMaker && aws.explorer.showAuthView" + }, + "aws-amazonq-q-squid-ink": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1ab" } - ] - }, - "submenus": [ - { - "id": "aws.toolkit.auth", - "label": "%AWS.submenu.auth.title%", - "icon": "$(ellipsis)", - "when": "isCloud9 || !aws.isWebExtHost" }, - { - "id": "aws.codecatalyst.submenu", - "label": "%AWS.codecatalyst.submenu.title%", - "icon": "$(ellipsis)", - "when": "isCloud9 || !aws.isWebExtHost" + "aws-amazonq-q-white": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1ac" + } }, - { - "label": "%AWS.generic.feedback%", - "id": "aws.toolkit.submenu.feedback" + "aws-amazonq-transform-arrow-dark": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1ad" + } }, - { - "label": "%AWS.generic.help%", - "id": "aws.toolkit.submenu.help" - } - ], - "menus": { - "commandPalette": [ - { - "command": "aws.apig.copyUrl", - "when": "false" - }, - { - "command": "aws.apig.invokeRemoteRestApi", - "when": "false" - }, - { - "command": "aws.deleteCloudFormation", - "when": "false" - }, - { - "command": "aws.downloadStateMachineDefinition", - "when": "false" - }, - { - "command": "aws.ecr.createRepository", - "when": "false" - }, - { - "command": "aws.executeStateMachine", - "when": "false" - }, - { - "command": "aws.copyArn", - "when": "false" - }, - { - "command": "aws.copyName", - "when": "false" - }, - { - "command": "aws.listCommands", - "when": "false" - }, - { - "command": "aws.codecatalyst.listCommands", - "when": "false" - }, - { - "command": "aws.codecatalyst.manageConnections", - "when": "false" - }, - { - "command": "aws.codecatalyst.openDevEnv", - "when": "!isCloud9" - }, - { - "command": "aws.codecatalyst.createDevEnv", - "when": "!isCloud9" - }, - { - "command": "aws.downloadSchemaItemCode", - "when": "false" - }, - { - "command": "aws.deleteLambda", - "when": "false" - }, - { - "command": "aws.downloadLambda", - "when": "false" - }, - { - "command": "aws.invokeLambda", - "when": "false" - }, - { - "command": "aws.copyLambdaUrl", - "when": "false" - }, - { - "command": "aws.viewSchemaItem", - "when": "false" - }, - { - "command": "aws.searchSchema", - "when": "false" - }, - { - "command": "aws.searchSchemaPerRegistry", - "when": "false" - }, - { - "command": "aws.refreshAwsExplorer", - "when": "false" - }, - { - "command": "aws.cdk.refresh", - "when": "false" - }, - { - "command": "aws.cdk.viewDocs", - "when": "false" - }, - { - "command": "aws.ssmDocument.openLocalDocument", - "when": "false" - }, - { - "command": "aws.ssmDocument.openLocalDocumentJson", - "when": "false" - }, - { - "command": "aws.ssmDocument.openLocalDocumentYaml", - "when": "false" - }, - { - "command": "aws.ssmDocument.deleteDocument", - "when": "false" - }, - { - "command": "aws.ssmDocument.updateDocumentVersion", - "when": "false" - }, - { - "command": "aws.copyLogResource", - "when": "resourceScheme == aws-cwl" - }, - { - "command": "aws.saveCurrentLogDataContent", - "when": "resourceScheme == aws-cwl" - }, - { - "command": "aws.s3.editFile", - "when": "resourceScheme == s3-readonly" - }, - { - "command": "aws.cwl.viewLogStream", - "when": "false" - }, - { - "command": "aws.cwl.changeFilterPattern", - "when": "false" - }, - { - "command": "aws.cwl.changeTimeFilter", - "when": "false" - }, - { - "command": "aws.ecr.deleteRepository", - "when": "false" - }, - { - "command": "aws.ecr.copyTagUri", - "when": "false" - }, - { - "command": "aws.ecr.copyRepositoryUri", - "when": "false" - }, - { - "command": "aws.ecr.deleteTag", - "when": "false" - }, - { - "command": "aws.iot.createThing", - "when": "false" - }, - { - "command": "aws.iot.deleteThing", - "when": "false" - }, - { - "command": "aws.iot.createCert", - "when": "false" - }, - { - "command": "aws.iot.deleteCert", - "when": "false" - }, - { - "command": "aws.iot.attachCert", - "when": "false" - }, - { - "command": "aws.iot.attachPolicy", - "when": "false" - }, - { - "command": "aws.iot.activateCert", - "when": "false" - }, - { - "command": "aws.iot.deactivateCert", - "when": "false" - }, - { - "command": "aws.iot.revokeCert", - "when": "false" - }, - { - "command": "aws.iot.createPolicy", - "when": "false" - }, - { - "command": "aws.iot.deletePolicy", - "when": "false" - }, - { - "command": "aws.iot.createPolicyVersion", - "when": "false" - }, - { - "command": "aws.iot.deletePolicyVersion", - "when": "false" - }, - { - "command": "aws.iot.detachCert", - "when": "false" - }, - { - "command": "aws.iot.detachPolicy", - "when": "false" - }, - { - "command": "aws.iot.viewPolicyVersion", - "when": "false" - }, - { - "command": "aws.iot.setDefaultPolicy", - "when": "false" - }, - { - "command": "aws.iot.copyEndpoint", - "when": "false" - }, - { - "command": "aws.deploySamApplication", - "when": "config.aws.samcli.legacyDeploy" - }, - { - "command": "aws.redshift.editConnection", - "when": "false" - }, - { - "command": "aws.redshift.deleteConnection", - "when": "false" - }, - { - "command": "aws.samcli.sync", - "when": "!config.aws.samcli.legacyDeploy" - }, - { - "command": "aws.s3.copyPath", - "when": "false" - }, - { - "command": "aws.s3.createBucket", - "when": "false" - }, - { - "command": "aws.s3.createFolder", - "when": "false" - }, - { - "command": "aws.s3.deleteBucket", - "when": "false" - }, - { - "command": "aws.s3.deleteFile", - "when": "false" - }, - { - "command": "aws.s3.downloadFileAs", - "when": "false" - }, - { - "command": "aws.s3.openFile", - "when": "false" - }, - { - "command": "aws.s3.editFile", - "when": "false" - }, - { - "command": "aws.s3.uploadFileToParent", - "when": "false" - }, - { - "command": "aws.apprunner.startDeployment", - "when": "false" - }, - { - "command": "aws.apprunner.createService", - "when": "false" - }, - { - "command": "aws.apprunner.pauseService", - "when": "false" - }, - { - "command": "aws.apprunner.resumeService", - "when": "false" - }, - { - "command": "aws.apprunner.copyServiceUrl", - "when": "false" - }, - { - "command": "aws.apprunner.open", - "when": "false" - }, - { - "command": "aws.apprunner.deleteService", - "when": "false" - }, - { - "command": "aws.apprunner.createServiceFromEcr", - "when": "false" - }, - { - "command": "aws.resources.copyIdentifier", - "when": "false" - }, - { - "command": "aws.resources.openResourcePreview", - "when": "false" - }, - { - "command": "aws.resources.createResource", - "when": "false" - }, - { - "command": "aws.resources.deleteResource", - "when": "false" - }, - { - "command": "aws.resources.updateResource", - "when": "false" - }, - { - "command": "aws.resources.updateResourceInline", - "when": "false" - }, - { - "command": "aws.resources.saveResource", - "when": "false" - }, - { - "command": "aws.resources.closeResource", - "when": "false" - }, - { - "command": "aws.resources.viewDocs", - "when": "false" - }, - { - "command": "aws.ecs.runCommandInContainer", - "when": "false" - }, - { - "command": "aws.ecs.openTaskInTerminal", - "when": "false" - }, - { - "command": "aws.ecs.enableEcsExec", - "when": "false" - }, - { - "command": "aws.ecs.disableEcsExec", - "when": "false" - }, - { - "command": "aws.ecs.viewDocumentation", - "when": "false" - }, - { - "command": "aws.renderStateMachineGraph", - "when": "false" - }, - { - "command": "aws.toolkit.auth.addConnection", - "when": "false" - }, - { - "command": "aws.toolkit.auth.switchConnections", - "when": "false" - }, - { - "command": "aws.toolkit.auth.help", - "when": "false" - }, - { - "command": "aws.toolkit.auth.manageConnections" - }, - { - "command": "aws.ec2.viewLogs", - "when": "aws.isDevMode" - }, - { - "command": "aws.ec2.openRemoteConnection", - "when": "aws.isDevMode" - }, - { - "command": "aws.ec2.openTerminal", - "when": "aws.isDevMode" - }, - { - "command": "aws.ec2.startInstance", - "when": "aws.isDevMode" - }, - { - "command": "aws.ec2.stopInstance", - "when": "aws.isDevMode" - }, - { - "command": "aws.ec2.rebootInstance", - "when": "aws.isDevMode" - }, - { - "command": "aws.dev.openMenu", - "when": "aws.isDevMode || isCloud9" - }, - { - "command": "aws.openInApplicationComposer", - "when": "false" - }, - { - "command": "aws.toolkit.amazonq.learnMore", - "when": "false" - }, - { - "command": "aws.toolkit.amazonq.extensionpage", - "when": "false" - }, - { - "command": "aws.newThreatComposerFile", - "when": "false" + "aws-amazonq-transform-arrow-light": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1ae" } - ], - "editor/title": [ - { - "command": "aws.previewStateMachine", - "when": "editorLangId == asl || editorLangId == asl-yaml", - "group": "navigation" - }, - { - "command": "aws.saveCurrentLogDataContent", - "when": "resourceScheme == aws-cwl", - "group": "navigation" - }, - { - "command": "aws.cwl.changeFilterPattern", - "when": "resourceScheme == aws-cwl", - "group": "navigation" - }, - { - "command": "aws.cwl.changeTimeFilter", - "when": "resourceScheme == aws-cwl", - "group": "navigation" - }, - { - "command": "aws.s3.editFile", - "when": "resourceScheme == s3-readonly", - "group": "navigation" - }, - { - "command": "aws.ssmDocument.publishDocument", - "when": "editorLangId =~ /^(ssm-yaml|ssm-json)$/", - "group": "navigation" - }, - { - "command": "aws.resources.updateResourceInline", - "when": "resourceScheme == awsResource && !isCloud9 && config.aws.experiments.jsonResourceModification", - "group": "navigation" - }, - { - "command": "aws.resources.closeResource", - "when": "resourcePath =~ /^.+(awsResource.json)$/", - "group": "navigation" - }, - { - "command": "aws.resources.saveResource", - "when": "resourcePath =~ /^.+(awsResource.json)$/", - "group": "navigation" - }, - { - "command": "aws.openInApplicationComposer", - "when": "(editorLangId == json && !(resourceFilename =~ /^.*\\.tc\\.json$/)) || editorLangId == yaml || resourceFilename =~ /^.*\\.(template)$/", - "group": "navigation" + }, + "aws-amazonq-transform-default-dark": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1af" } - ], - "editor/title/context": [ - { - "command": "aws.copyLogResource", - "when": "resourceScheme == aws-cwl", - "group": "1_cutcopypaste@1" + }, + "aws-amazonq-transform-default-light": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b0" } - ], - "view/title": [ - { - "command": "aws.toolkit.submitFeedback", - "when": "view == aws.explorer && !aws.isWebExtHost", - "group": "navigation@6" - }, - { - "command": "aws.refreshAwsExplorer", - "when": "view == aws.explorer", - "group": "navigation@5" - }, - { - "command": "aws.cdk.refresh", - "when": "view == aws.cdk", - "group": "navigation@1" - }, - { - "command": "aws.toolkit.login", - "when": "view == aws.explorer", - "group": "1_account@1" - }, - { - "command": "aws.showRegion", - "when": "view == aws.explorer", - "group": "1_account@2" - }, - { - "command": "aws.listCommands", - "when": "view == aws.explorer && !isCloud9", - "group": "1_account@3" - }, - { - "command": "aws.lambda.createNewSamApp", - "when": "view == aws.explorer", - "group": "3_lambda@1" - }, - { - "command": "aws.launchConfigForm", - "when": "view == aws.explorer", - "group": "3_lambda@2" - }, - { - "command": "aws.deploySamApplication", - "when": "config.aws.samcli.legacyDeploy && view == aws.explorer", - "group": "3_lambda@3" - }, - { - "command": "aws.samcli.sync", - "when": "!config.aws.samcli.legacyDeploy && view == aws.explorer", - "group": "3_lambda@3" - }, - { - "submenu": "aws.toolkit.submenu.feedback", - "when": "view =~ /^aws\\./ && view != aws.AmazonQChatView && view != aws.amazonq.AmazonCommonAuth", - "group": "y_toolkitMeta@1" - }, - { - "submenu": "aws.toolkit.submenu.help", - "when": "view =~ /^aws\\./ && view != aws.AmazonQChatView && view != aws.amazonq.AmazonCommonAuth", - "group": "y_toolkitMeta@2" - }, - { - "command": "aws.codecatalyst.cloneRepo", - "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", - "group": "1_codeCatalyst@1" - }, - { - "command": "aws.codecatalyst.createDevEnv", - "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", - "group": "1_codeCatalyst@1" - }, - { - "command": "aws.codecatalyst.listCommands", - "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", - "group": "1_codeCatalyst@1" - }, - { - "command": "aws.codecatalyst.openDevEnv", - "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", - "group": "1_codeCatalyst@1" - }, - { - "command": "aws.codecatalyst.manageConnections", - "when": "view == aws.codecatalyst && !isCloud9 && !aws.codecatalyst.connected", - "group": "2_codeCatalyst@1" - }, - { - "command": "aws.codecatalyst.signout", - "when": "view == aws.codecatalyst && !isCloud9 && aws.codecatalyst.connected", - "group": "2_codeCatalyst@1" + }, + "aws-amazonq-transform-dependencies-dark": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b1" } - ], - "explorer/context": [ - { - "command": "aws.deploySamApplication", - "when": "config.aws.samcli.legacyDeploy && isFileSystemResource && resourceFilename =~ /^template\\.(json|yml|yaml)$/", - "group": "z_aws@1" - }, - { - "command": "aws.samcli.sync", - "when": "!config.aws.samcli.legacyDeploy && isFileSystemResource && resourceFilename =~ /^(template\\.(json|yml|yaml))|(samconfig\\.toml)$/", - "group": "z_aws@1" - }, - { - "command": "aws.uploadLambda", - "when": "explorerResourceIsFolder || isFileSystemResource && resourceFilename =~ /^template\\.(json|yml|yaml)$/", - "group": "z_aws@3" - }, - { - "command": "aws.openInApplicationComposer", - "when": "isFileSystemResource && !(resourceFilename =~ /^.*\\.tc\\.json$/) && resourceFilename =~ /^.*\\.(json|yml|yaml|template)$/", - "group": "z_aws@1" - } - ], - "view/item/context": [ - { - "command": "aws.apig.invokeRemoteRestApi", - "when": "view == aws.explorer && viewItem =~ /^(awsApiGatewayNode)$/", - "group": "0@1" - }, - { - "command": "aws.ec2.openTerminal", - "group": "0@1", - "when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/" - }, - { - "command": "aws.ec2.openTerminal", - "group": "inline@1", - "when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/" - }, - { - "command": "aws.ec2.openRemoteConnection", - "group": "0@1", - "when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/" - }, - { - "command": "aws.ec2.openRemoteConnection", - "group": "inline@1", - "when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/" - }, - { - "command": "aws.ec2.startInstance", - "group": "0@1", - "when": "viewItem == awsEc2StoppedNode" - }, - { - "command": "aws.ec2.startInstance", - "group": "inline@1", - "when": "viewItem == awsEc2StoppedNode" - }, - { - "command": "aws.ec2.stopInstance", - "group": "0@1", - "when": "viewItem == awsEc2RunningNode" - }, - { - "command": "aws.ec2.stopInstance", - "group": "inline@1", - "when": "viewItem == awsEc2RunningNode" - }, - { - "command": "aws.ec2.rebootInstance", - "group": "0@1", - "when": "viewItem == awsEc2RunningNode" - }, - { - "command": "aws.ec2.rebootInstance", - "group": "inline@1", - "when": "viewItem == awsEc2RunningNode" - }, - { - "command": "aws.ecr.createRepository", - "when": "view == aws.explorer && viewItem == awsEcrNode", - "group": "inline@1" - }, - { - "command": "aws.iot.createThing", - "when": "view == aws.explorer && viewItem == awsIotThingsNode", - "group": "inline@1" - }, - { - "command": "aws.iot.createCert", - "when": "view == aws.explorer && viewItem == awsIotCertsNode", - "group": "inline@1" - }, - { - "command": "aws.iot.createPolicy", - "when": "view == aws.explorer && viewItem == awsIotPoliciesNode", - "group": "inline@1" - }, - { - "command": "aws.iot.attachCert", - "when": "view == aws.explorer && viewItem == awsIotThingNode", - "group": "inline@1" - }, - { - "command": "aws.iot.attachPolicy", - "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies)/", - "group": "inline@1" - }, - { - "command": "aws.redshift.editConnection", - "when": "view == aws.explorer && viewItem == awsRedshiftWarehouseNode", - "group": "0@1" - }, - { - "command": "aws.redshift.deleteConnection", - "when": "view == aws.explorer && viewItem == awsRedshiftWarehouseNode", - "group": "0@2" - }, - { - "command": "aws.s3.openFile", - "when": "view == aws.explorer && viewItem == awsS3FileNode && !isCloud9", - "group": "0@1" - }, - { - "command": "aws.s3.editFile", - "when": "view == aws.explorer && viewItem == awsS3FileNode && !isCloud9", - "group": "inline@1" - }, - { - "command": "aws.s3.downloadFileAs", - "when": "view == aws.explorer && viewItem == awsS3FileNode", - "group": "inline@2" - }, - { - "command": "aws.s3.createBucket", - "when": "view == aws.explorer && viewItem == awsS3Node", - "group": "inline@1" - }, - { - "command": "aws.s3.createFolder", - "when": "view == aws.explorer && viewItem =~ /^(awsS3BucketNode|awsS3FolderNode)$/", - "group": "inline@1" - }, - { - "command": "aws.ssmDocument.openLocalDocument", - "when": "view == aws.explorer && viewItem =~ /^(awsDocumentItemNode|awsDocumentItemNodeWriteable)$/", - "group": "inline@1" - }, - { - "command": "aws.s3.uploadFile", - "when": "view == aws.explorer && viewItem =~ /^(awsS3BucketNode|awsS3FolderNode)$/", - "group": "inline@2" - }, - { - "command": "aws.showRegion", - "when": "view == aws.explorer && viewItem == awsRegionNode", - "group": "0@1" - }, - { - "command": "aws.lambda.createNewSamApp", - "when": "view == aws.explorer && viewItem == awsLambdaNode || viewItem == awsRegionNode", - "group": "1@1" - }, - { - "command": "aws.launchConfigForm", - "when": "view == aws.explorer && viewItem == awsLambdaNode || viewItem == awsRegionNode || viewItem == awsCloudFormationRootNode", - "group": "1@1" - }, - { - "command": "aws.deploySamApplication", - "when": "config.aws.samcli.legacyDeploy && view == aws.explorer && viewItem =~ /^(awsLambdaNode|awsRegionNode|awsCloudFormationRootNode)$/", - "group": "1@2" - }, - { - "command": "aws.samcli.sync", - "when": "!config.aws.samcli.legacyDeploy && view == aws.explorer && viewItem =~ /^(awsLambdaNode|awsRegionNode|awsCloudFormationRootNode)$/", - "group": "1@2" - }, - { - "command": "aws.ec2.copyInstanceId", - "when": "view == aws.explorer && viewItem =~ /^(awsEc2(Parent|Running|Stopped)Node)$/", - "group": "2@0" - }, - { - "command": "aws.ec2.viewLogs", - "when": "view == aws.explorer && viewItem =~ /^(awsEc2(Pending|Running|Stopped)Node)$/", - "group": "3@0" - }, - { - "command": "aws.ecr.copyTagUri", - "when": "view == aws.explorer && viewItem == awsEcrTagNode", - "group": "2@1" - }, - { - "command": "aws.ecr.deleteTag", - "when": "view == aws.explorer && viewItem == awsEcrTagNode", - "group": "3@1" - }, - { - "command": "aws.ecr.copyRepositoryUri", - "when": "view == aws.explorer && viewItem == awsEcrRepositoryNode", - "group": "2@1" - }, - { - "command": "aws.ecr.createRepository", - "when": "view == aws.explorer && viewItem == awsEcrNode", - "group": "0@1" - }, - { - "command": "aws.ecr.deleteRepository", - "when": "view == aws.explorer && viewItem == awsEcrRepositoryNode", - "group": "3@1" - }, - { - "command": "aws.invokeLambda", - "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode)$/", - "group": "0@1" - }, - { - "command": "aws.downloadLambda", - "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/", - "group": "0@2" - }, - { - "command": "aws.uploadLambda", - "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/", - "group": "1@1" - }, - { - "command": "aws.deleteLambda", - "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/", - "group": "4@1" - }, - { - "command": "aws.copyLambdaUrl", - "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable)$/", - "group": "2@0" - }, - { - "command": "aws.deleteCloudFormation", - "when": "view == aws.explorer && viewItem == awsCloudFormationNode", - "group": "3@5" - }, - { - "command": "aws.searchSchema", - "when": "view == aws.explorer && viewItem == awsSchemasNode", - "group": "0@1" - }, - { - "command": "aws.searchSchemaPerRegistry", - "when": "view == aws.explorer && viewItem == awsRegistryItemNode", - "group": "0@1" - }, - { - "command": "aws.viewSchemaItem", - "when": "view == aws.explorer && viewItem == awsSchemaItemNode", - "group": "0@1" - }, - { - "command": "aws.stepfunctions.createStateMachineFromTemplate", - "when": "view == aws.explorer && viewItem == awsStepFunctionsNode", - "group": "0@1" - }, - { - "command": "aws.downloadStateMachineDefinition", - "when": "view == aws.explorer && viewItem == awsStateMachineNode", - "group": "0@1" - }, - { - "command": "aws.renderStateMachineGraph", - "when": "view == aws.explorer && viewItem == awsStateMachineNode", - "group": "0@2" - }, - { - "command": "aws.cdk.renderStateMachineGraph", - "when": "viewItem == awsCdkStateMachineNode", - "group": "inline@1" - }, - { - "command": "aws.cdk.renderStateMachineGraph", - "when": "viewItem == awsCdkStateMachineNode", - "group": "0@1" - }, - { - "command": "aws.executeStateMachine", - "when": "view == aws.explorer && viewItem == awsStateMachineNode", - "group": "0@3" - }, - { - "command": "aws.iot.createThing", - "when": "view == aws.explorer && viewItem == awsIotThingsNode", - "group": "0@1" - }, - { - "command": "aws.iot.createCert", - "when": "view == aws.explorer && viewItem == awsIotCertsNode", - "group": "0@1" - }, - { - "command": "aws.iot.createPolicy", - "when": "view == aws.explorer && viewItem == awsIotPoliciesNode", - "group": "0@1" - }, - { - "command": "aws.iot.createPolicyVersion", - "when": "view == aws.explorer && viewItem == awsIotPolicyNode.WithVersions", - "group": "0@1" - }, - { - "command": "aws.iot.viewPolicyVersion", - "when": "view == aws.explorer && viewItem =~ /^awsIotPolicyVersionNode./", - "group": "0@1" - }, - { - "command": "aws.iot.attachCert", - "when": "view == aws.explorer && viewItem == awsIotThingNode", - "group": "0@1" - }, - { - "command": "aws.iot.attachPolicy", - "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies)/", - "group": "0@1" - }, - { - "command": "aws.s3.createBucket", - "when": "view == aws.explorer && viewItem == awsS3Node", - "group": "0@1" - }, - { - "command": "aws.s3.downloadFileAs", - "when": "view == aws.explorer && viewItem == awsS3FileNode", - "group": "0@1" - }, - { - "command": "aws.s3.uploadFile", - "when": "view == aws.explorer && viewItem =~ /^(awsS3BucketNode|awsS3FolderNode)$/", - "group": "0@1" - }, - { - "command": "aws.s3.uploadFileToParent", - "when": "view == aws.explorer && viewItem == awsS3FileNode", - "group": "1@1" - }, - { - "command": "aws.s3.createFolder", - "when": "view == aws.explorer && viewItem =~ /^(awsS3BucketNode|awsS3FolderNode)$/", - "group": "1@1" - }, - { - "command": "aws.iot.deactivateCert", - "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies).ACTIVE$/", - "group": "1@1" - }, - { - "command": "aws.iot.activateCert", - "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies).INACTIVE$/", - "group": "1@1" - }, - { - "command": "aws.iot.revokeCert", - "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.(Things|Policies).(ACTIVE|INACTIVE)$/", - "group": "1@2" - }, - { - "command": "aws.iot.setDefaultPolicy", - "when": "view == aws.explorer && viewItem == awsIotPolicyVersionNode.NONDEFAULT", - "group": "1@1" - }, - { - "command": "aws.iot.copyEndpoint", - "when": "view == aws.explorer && viewItem == awsIotNode", - "group": "2@1" - }, - { - "command": "aws.copyName", - "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode|awsStateMachineNode|awsCloudFormationNode|awsS3BucketNode|awsS3FolderNode|awsS3FileNode|awsApiGatewayNode|awsIotThingNode)$|^(awsAppRunnerServiceNode|awsIotCertificateNode|awsIotPolicyNode|awsIotPolicyVersionNode|(awsEc2(Running|Pending|Stopped)Node))/", - "group": "2@1" - }, - { - "command": "aws.copyArn", - "when": "view == aws.explorer && viewItem =~ /^(awsRegionFunctionNode|awsRegionFunctionNodeDownloadable|awsCloudFormationFunctionNode|awsStateMachineNode|awsCloudFormationNode|awsCloudWatchLogNode|awsS3BucketNode|awsS3FolderNode|awsS3FileNode|awsApiGatewayNode|awsEcrRepositoryNode|awsIotThingNode)$|^(awsAppRunnerServiceNode|awsEcsServiceNode|awsIotCertificateNode|awsIotPolicyNode|awsIotPolicyVersionNode|awsMdeInstanceNode|(awsEc2(Running|Pending|Stopped)Node))/", - "group": "2@2" - }, - { - "command": "aws.cwl.searchLogGroup", - "group": "0@1", - "when": "view == aws.explorer && viewItem =~ /^awsCloudWatchLogNode|awsCloudWatchLogParentNode$/" - }, - { - "command": "aws.cwl.searchLogGroup", - "group": "inline@1", - "when": "view == aws.explorer && viewItem =~ /^awsCloudWatchLogNode|awsCloudWatchLogParentNode$/" - }, - { - "command": "aws.apig.copyUrl", - "when": "view == aws.explorer && viewItem =~ /^(awsApiGatewayNode)$/", - "group": "2@0" - }, - { - "command": "aws.s3.copyPath", - "when": "view == aws.explorer && viewItem =~ /^(awsS3FolderNode|awsS3FileNode)$/", - "group": "2@3" - }, - { - "command": "aws.s3.presignedURL", - "when": "view == aws.explorer && viewItem =~ /^(awsS3FileNode)$/", - "group": "2@4" - }, - { - "command": "aws.iot.detachCert", - "when": "view == aws.explorer && viewItem =~ /^(awsIotCertificateNode.Things)/", - "group": "3@1" - }, - { - "command": "aws.iot.detachPolicy", - "when": "view == aws.explorer && viewItem == awsIotPolicyNode.Certificates", - "group": "3@1" - }, - { - "command": "aws.iot.deleteThing", - "when": "view == aws.explorer && viewItem == awsIotThingNode", - "group": "3@1" - }, - { - "command": "aws.iot.deleteCert", - "when": "view == aws.explorer && viewItem =~ /^awsIotCertificateNode.Policies/", - "group": "3@1" - }, - { - "command": "aws.iot.deletePolicy", - "when": "view == aws.explorer && viewItem == awsIotPolicyNode.WithVersions", - "group": "3@1" - }, - { - "command": "aws.iot.deletePolicyVersion", - "when": "view == aws.explorer && viewItem == awsIotPolicyVersionNode.NONDEFAULT", - "group": "3@1" - }, - { - "command": "aws.s3.deleteBucket", - "when": "view == aws.explorer && viewItem == awsS3BucketNode", - "group": "3@1" - }, - { - "command": "aws.s3.deleteFile", - "when": "view == aws.explorer && viewItem == awsS3FileNode", - "group": "3@1" - }, - { - "command": "aws.downloadSchemaItemCode", - "when": "view == aws.explorer && viewItem == awsSchemaItemNode", - "group": "1@1" - }, - { - "command": "aws.cwl.viewLogStream", - "group": "0@1", - "when": "view == aws.explorer && viewItem == awsCloudWatchLogNode" - }, - { - "command": "aws.ssmDocument.openLocalDocumentYaml", - "group": "0@1", - "when": "view == aws.explorer && viewItem =~ /^(awsDocumentItemNode|awsDocumentItemNodeWriteable)$/" - }, - { - "command": "aws.ssmDocument.openLocalDocumentJson", - "group": "0@2", - "when": "view == aws.explorer && viewItem =~ /^(awsDocumentItemNode|awsDocumentItemNodeWriteable)$/" - }, - { - "command": "aws.ssmDocument.updateDocumentVersion", - "group": "2@1", - "when": "view == aws.explorer && viewItem == awsDocumentItemNodeWriteable" - }, - { - "command": "aws.ssmDocument.deleteDocument", - "group": "3@2", - "when": "view == aws.explorer && viewItem == awsDocumentItemNodeWriteable" - }, - { - "command": "aws.ecs.runCommandInContainer", - "group": "0@1", - "when": "view == aws.explorer && viewItem =~ /^(awsEcsContainerNodeExec)(.*)$/" - }, - { - "command": "aws.ecs.openTaskInTerminal", - "group": "0@2", - "when": "view == aws.explorer && viewItem =~ /^(awsEcsContainerNodeExec)(.*)$/ && !isCloud9" - }, - { - "command": "aws.ecs.enableEcsExec", - "group": "0@2", - "when": "view == aws.explorer && viewItem == awsEcsServiceNode.DISABLED" - }, - { - "command": "aws.ecs.disableEcsExec", - "group": "0@2", - "when": "view == aws.explorer && viewItem == awsEcsServiceNode.ENABLED" - }, - { - "command": "aws.ecs.viewDocumentation", - "group": "1@3", - "when": "view == aws.explorer && viewItem =~ /^(awsEcsClusterNode|awsEcsContainerNode)$|^awsEcsServiceNode/" - }, - { - "command": "aws.resources.configure", - "when": "view == aws.explorer && viewItem == resourcesRootNode", - "group": "1@1" - }, - { - "command": "aws.resources.configure", - "when": "view == aws.explorer && viewItem == resourcesRootNode", - "group": "inline@1" - }, - { - "command": "aws.resources.openResourcePreview", - "when": "view == aws.explorer && viewItem =~ /^(.*)(ResourceNode)$/", - "group": "1@1" - }, - { - "command": "aws.resources.copyIdentifier", - "when": "view == aws.explorer && viewItem =~ /^(.*)(ResourceNode)$/", - "group": "1@1" - }, - { - "command": "aws.resources.viewDocs", - "when": "view == aws.explorer && viewItem =~ /^(.*)(Documented)(.*)(ResourceTypeNode)$/", - "group": "1@1" - }, - { - "command": "aws.resources.createResource", - "when": "view == aws.explorer && viewItem =~ /^(.*)(Creatable)(.*)(ResourceTypeNode)$/ && !isCloud9 && config.aws.experiments.jsonResourceModification", - "group": "2@1" - }, - { - "command": "aws.resources.createResource", - "when": "view == aws.explorer && viewItem =~ /^(.*)(Creatable)(.*)(ResourceTypeNode)$/ && !isCloud9 && config.aws.experiments.jsonResourceModification", - "group": "inline@1" - }, - { - "command": "aws.resources.updateResource", - "when": "view == aws.explorer && viewItem =~ /^(.*)(Updatable)(.*)(ResourceNode)$/ && !isCloud9 && config.aws.experiments.jsonResourceModification", - "group": "2@1" - }, - { - "command": "aws.resources.deleteResource", - "when": "view == aws.explorer && viewItem =~ /^(.*)(Deletable)(.*)(ResourceNode)$/ && !isCloud9 && config.aws.experiments.jsonResourceModification", - "group": "2@2" - }, - { - "command": "aws.apprunner.createServiceFromEcr", - "group": "0@2", - "when": "view == aws.explorer && viewItem =~ /awsEcrTagNode|awsEcrRepositoryNode/" - }, - { - "command": "aws.apprunner.startDeployment", - "group": "0@1", - "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.RUNNING" - }, - { - "command": "aws.apprunner.createService", - "group": "0@2", - "when": "view == aws.explorer && viewItem == awsAppRunnerNode" - }, - { - "command": "aws.apprunner.pauseService", - "group": "0@3", - "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.RUNNING" - }, - { - "command": "aws.apprunner.resumeService", - "group": "0@3", - "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.PAUSED" - }, - { - "command": "aws.apprunner.copyServiceUrl", - "group": "1@1", - "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.RUNNING" - }, - { - "command": "aws.apprunner.open", - "group": "1@2", - "when": "view == aws.explorer && viewItem == awsAppRunnerServiceNode.RUNNING" - }, - { - "command": "aws.apprunner.deleteService", - "group": "3@1", - "when": "view == aws.explorer && viewItem =~ /awsAppRunnerServiceNode.[RUNNING|PAUSED|CREATE_FAILED]/" - }, - { - "command": "aws.cloudFormation.newTemplate", - "group": "0@1", - "when": "view == aws.explorer && viewItem == awsCloudFormationRootNode" - }, - { - "command": "aws.sam.newTemplate", - "group": "0@2", - "when": "view == aws.explorer && viewItem == awsCloudFormationRootNode" - }, - { - "command": "aws.cdk.viewDocs", - "when": "viewItem == awsCdkRootNode", - "group": "0@2" - }, - { - "command": "aws.toolkit.auth.addConnection", - "when": "viewItem == awsAuthNode", - "group": "0@1" - }, - { - "command": "aws.toolkit.auth.switchConnections", - "when": "viewItem == awsAuthNode", - "group": "0@2" - }, - { - "command": "aws.toolkit.auth.signout", - "when": "viewItem == awsAuthNode && !isCloud9", - "group": "0@3" - }, - { - "command": "aws.toolkit.auth.help", - "when": "viewItem == awsAuthNode", - "group": "inline@1" - }, - { - "submenu": "aws.toolkit.auth", - "when": "viewItem == awsAuthNode", - "group": "inline@2" - }, - { - "submenu": "aws.codecatalyst.submenu", - "when": "viewItem =~ /^awsCodeCatalystNode/", - "group": "inline@1" - }, - { - "command": "aws.codecatalyst.manageConnections", - "when": "viewItem =~ /^awsCodeCatalystNode/", - "group": "0@1" - }, - { - "command": "aws.codecatalyst.signout", - "when": "viewItem =~ /^awsCodeCatalystNode/&& !isCloud9 && aws.codecatalyst.connected", - "group": "0@2" - } - ], - "aws.toolkit.auth": [ - { - "command": "aws.toolkit.auth.manageConnections", - "group": "0@1" - }, - { - "command": "aws.toolkit.auth.switchConnections", - "group": "0@2" - }, - { - "command": "aws.toolkit.auth.signout", - "enablement": "!isCloud9", - "group": "0@3" - } - ], - "aws.toolkit.submenu.feedback": [ - { - "command": "aws.toolkit.submitFeedback", - "when": "!aws.isWebExtHost", - "group": "1_feedback@1" - }, - { - "command": "aws.toolkit.createIssueOnGitHub", - "group": "1_feedback@2" - } - ], - "aws.toolkit.submenu.help": [ - { - "command": "aws.quickStart", - "when": "isCloud9", - "group": "1_help@1" - }, - { - "command": "aws.toolkit.help", - "group": "1_help@2" - }, - { - "command": "aws.toolkit.github", - "group": "1_help@3" - }, - { - "command": "aws.toolkit.aboutExtension", - "group": "1_help@4" - }, - { - "command": "aws.toolkit.viewLogs", - "group": "1_help@5" - } - ], - "file/newFile": [ - { - "command": "aws.newThreatComposerFile" - } - ] - }, - "commands": [ - { - "command": "aws.accessanalyzer.iamPolicyChecks", - "title": "%AWS.command.accessanalyzer.iamPolicyChecks%", - "category": "%AWS.title%" - }, - { - "command": "aws.launchConfigForm", - "title": "%AWS.command.launchConfigForm.title%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apig.copyUrl", - "title": "%AWS.command.apig.copyUrl%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apig.invokeRemoteRestApi", - "title": "%AWS.command.apig.invokeRemoteRestApi%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%", - "title": "%AWS.command.apig.invokeRemoteRestApi.cn%" - } - } - }, - { - "command": "aws.lambda.createNewSamApp", - "title": "%AWS.command.createNewSamApp%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.toolkit.login", - "title": "%AWS.command.login%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "title": "%AWS.command.login.cn%", - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.toolkit.credentials.profile.create", - "title": "%AWS.command.credentials.profile.create%", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.toolkit.credentials.edit", - "title": "%AWS.command.credentials.edit%", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.codecatalyst.openOrg", - "title": "%AWS.command.codecatalyst.openOrg%", - "category": "AWS", - "enablement": "isCloud9 || !aws.isWebExtHost" - }, - { - "command": "aws.codecatalyst.openProject", - "title": "%AWS.command.codecatalyst.openProject%", - "category": "AWS", - "enablement": "isCloud9 || !aws.isWebExtHost" - }, - { - "command": "aws.codecatalyst.openRepo", - "title": "%AWS.command.codecatalyst.openRepo%", - "category": "AWS", - "enablement": "isCloud9 || !aws.isWebExtHost" - }, - { - "command": "aws.codecatalyst.openDevEnv", - "title": "%AWS.command.codecatalyst.openDevEnv%", - "category": "AWS", - "enablement": "!isCloud9 && !aws.isWebExtHost" - }, - { - "command": "aws.codecatalyst.listCommands", - "title": "%AWS.command.codecatalyst.listCommands%", - "category": "AWS", - "enablement": "!isCloud9 && !aws.isWebExtHost" - }, - { - "command": "aws.codecatalyst.cloneRepo", - "title": "%AWS.command.codecatalyst.cloneRepo%", - "category": "AWS", - "enablement": "!isCloud9 && !aws.isWebExtHost" - }, - { - "command": "aws.codecatalyst.createDevEnv", - "title": "%AWS.command.codecatalyst.createDevEnv%", - "category": "AWS", - "enablement": "!isCloud9 && !aws.isWebExtHost" - }, - { - "command": "aws.codecatalyst.signout", - "title": "%AWS.command.codecatalyst.signout%", - "category": "AWS", - "icon": "$(debug-disconnect)", - "enablement": "isCloud9 || !aws.isWebExtHost" - }, - { - "command": "aws.toolkit.auth.addConnection", - "title": "%AWS.command.auth.addConnection%", - "category": "%AWS.title%" - }, - { - "command": "aws.toolkit.auth.manageConnections", - "title": "%AWS.command.auth.showConnectionsPage%", - "category": "%AWS.title%" - }, - { - "command": "aws.codecatalyst.manageConnections", - "title": "%AWS.command.auth.showConnectionsPage%", - "category": "%AWS.title%" - }, - { - "command": "aws.toolkit.auth.switchConnections", - "title": "%AWS.command.auth.switchConnections%", - "category": "%AWS.title%" - }, - { - "command": "aws.toolkit.auth.signout", - "title": "%AWS.command.auth.signout%", - "category": "%AWS.title%", - "enablement": "!isCloud9" - }, - { - "command": "aws.toolkit.auth.help", - "title": "%AWS.generic.viewDocs%", - "category": "%AWS.title%", - "icon": "$(question)" - }, - { - "command": "aws.toolkit.createIssueOnGitHub", - "title": "%AWS.command.createIssueOnGitHub%", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ec2.viewLogs", - "title": "%AWS.command.ec2.viewLogs%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ec2.openTerminal", - "title": "%AWS.command.ec2.openTerminal%", - "icon": "$(terminal-view-icon)", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ec2.openRemoteConnection", - "title": "%AWS.command.ec2.openRemoteConnection%", - "icon": "$(remote-explorer)", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ec2.startInstance", - "title": "%AWS.command.ec2.startInstance%", - "icon": "$(debug-start)", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ec2.stopInstance", - "title": "%AWS.command.ec2.stopInstance%", - "icon": "$(debug-stop)", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ec2.rebootInstance", - "title": "%AWS.command.ec2.rebootInstance%", - "icon": "$(debug-restart)", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ec2.copyInstanceId", - "title": "%AWS.command.ec2.copyInstanceId%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecr.copyTagUri", - "title": "%AWS.command.ecr.copyTagUri%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecr.deleteTag", - "title": "%AWS.command.ecr.deleteTag%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecr.copyRepositoryUri", - "title": "%AWS.command.ecr.copyRepositoryUri%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecr.createRepository", - "title": "%AWS.command.ecr.createRepository%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(add)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecr.deleteRepository", - "title": "%AWS.command.ecr.deleteRepository%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.showRegion", - "title": "%AWS.command.showRegion%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.createThing", - "title": "%AWS.command.iot.createThing%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(add)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.deleteThing", - "title": "%AWS.generic.promptDelete%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.createCert", - "title": "%AWS.command.iot.createCert%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(add)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.deleteCert", - "title": "%AWS.generic.promptDelete%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.attachCert", - "title": "%AWS.command.iot.attachCert%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(aws-generic-attach-file)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.attachPolicy", - "title": "%AWS.command.iot.attachPolicy%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(aws-generic-attach-file)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.activateCert", - "title": "%AWS.command.iot.activateCert%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.deactivateCert", - "title": "%AWS.command.iot.deactivateCert%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.revokeCert", - "title": "%AWS.command.iot.revokeCert%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.createPolicy", - "title": "%AWS.command.iot.createPolicy%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(add)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.deletePolicy", - "title": "%AWS.generic.promptDelete%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.createPolicyVersion", - "title": "%AWS.command.iot.createPolicyVersion%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.deletePolicyVersion", - "title": "%AWS.generic.promptDelete%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.detachCert", - "title": "%AWS.command.iot.detachCert%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.detachPolicy", - "title": "%AWS.command.iot.detachCert%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.viewPolicyVersion", - "title": "%AWS.command.iot.viewPolicyVersion%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.setDefaultPolicy", - "title": "%AWS.command.iot.setDefaultPolicy%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.iot.copyEndpoint", - "title": "%AWS.command.iot.copyEndpoint%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.redshift.editConnection", - "title": "Edit connection", - "category": "%AWS.title%" - }, - { - "command": "aws.redshift.deleteConnection", - "title": "Delete connection", - "category": "%AWS.title%" - }, - { - "command": "aws.s3.presignedURL", - "title": "%AWS.command.s3.presignedURL%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost" - }, - { - "command": "aws.s3.copyPath", - "title": "%AWS.command.s3.copyPath%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.s3.downloadFileAs", - "title": "%AWS.command.s3.downloadFileAs%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(cloud-download)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.s3.openFile", - "title": "%AWS.command.s3.openFile%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(open-preview)" - }, - { - "command": "aws.s3.editFile", - "title": "%AWS.command.s3.editFile%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(edit)" - }, - { - "command": "aws.s3.uploadFile", - "title": "%AWS.command.s3.uploadFile%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(cloud-upload)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.s3.uploadFileToParent", - "title": "%AWS.command.s3.uploadFileToParent%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.s3.createFolder", - "title": "%AWS.command.s3.createFolder%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(new-folder)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.s3.createBucket", - "title": "%AWS.command.s3.createBucket%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(aws-s3-create-bucket)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.s3.deleteBucket", - "title": "%AWS.generic.promptDelete%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.s3.deleteFile", - "title": "%AWS.generic.promptDelete%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.invokeLambda", - "title": "%AWS.command.invokeLambda%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "title": "%AWS.command.invokeLambda.cn%", - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.downloadLambda", - "title": "%AWS.command.downloadLambda%", - "category": "%AWS.title%", - "enablement": "viewItem == awsRegionFunctionNodeDownloadable", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.uploadLambda", - "title": "%AWS.command.uploadLambda%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.deleteLambda", - "title": "%AWS.generic.promptDelete%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.copyLambdaUrl", - "title": "%AWS.generic.copyUrl%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.deploySamApplication", - "title": "%AWS.command.deploySamApplication%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.toolkit.submitFeedback", - "title": "%AWS.command.submitFeedback%", - "enablement": "!aws.isWebExtHost", - "category": "%AWS.title%", - "icon": "$(comment)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.refreshAwsExplorer", - "title": "%AWS.command.refreshAwsExplorer%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "icon": { - "dark": "resources/icons/vscode/dark/refresh.svg", - "light": "resources/icons/vscode/light/refresh.svg" - } - }, - { - "command": "aws.samcli.detect", - "title": "%AWS.command.samcli.detect%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.deleteCloudFormation", - "title": "%AWS.command.deleteCloudFormation%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.downloadStateMachineDefinition", - "title": "%AWS.command.downloadStateMachineDefinition%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.executeStateMachine", - "title": "%AWS.command.executeStateMachine%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.renderStateMachineGraph", - "title": "%AWS.command.renderStateMachineGraph%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.copyArn", - "title": "%AWS.command.copyArn%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.copyName", - "title": "%AWS.command.copyName%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.listCommands", - "title": "%AWS.command.listCommands%", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "title": "%AWS.command.listCommands.cn%", - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.viewSchemaItem", - "title": "%AWS.command.viewSchemaItem%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.searchSchema", - "title": "%AWS.command.searchSchema%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.searchSchemaPerRegistry", - "title": "%AWS.command.searchSchemaPerRegistry%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.downloadSchemaItemCode", - "title": "%AWS.command.downloadSchemaItemCode%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.toolkit.viewLogs", - "title": "%AWS.command.viewLogs%", - "category": "%AWS.title%" - }, - { - "command": "aws.toolkit.help", - "title": "%AWS.command.help%", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.toolkit.github", - "title": "%AWS.command.github%", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.quickStart", - "title": "%AWS.command.quickStart%", - "category": "%AWS.title%", - "enablement": "isCloud9", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.cdk.refresh", - "title": "%AWS.command.refreshCdkExplorer%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": { - "dark": "resources/icons/vscode/dark/refresh.svg", - "light": "resources/icons/vscode/light/refresh.svg" - }, - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.cdk.viewDocs", - "title": "%AWS.generic.viewDocs%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost" - }, - { - "command": "aws.stepfunctions.createStateMachineFromTemplate", - "title": "%AWS.command.stepFunctions.createStateMachineFromTemplate%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.stepfunctions.publishStateMachine", - "title": "%AWS.command.stepFunctions.publishStateMachine%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.previewStateMachine", - "title": "%AWS.command.stepFunctions.previewStateMachine%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(aws-stepfunctions-preview)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.cdk.renderStateMachineGraph", - "title": "%AWS.command.cdk.previewStateMachine%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "AWS", - "icon": "$(aws-stepfunctions-preview)" - }, - { - "command": "aws.toolkit.aboutExtension", - "title": "%AWS.command.aboutToolkit%", - "category": "%AWS.title%" - }, - { - "command": "aws.cwl.viewLogStream", - "title": "%AWS.command.viewLogStream%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ssmDocument.createLocalDocument", - "title": "%AWS.command.ssmDocument.createLocalDocument%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ssmDocument.openLocalDocument", - "title": "%AWS.command.ssmDocument.openLocalDocument%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(cloud-download)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ssmDocument.openLocalDocumentJson", - "title": "%AWS.command.ssmDocument.openLocalDocumentJson%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ssmDocument.openLocalDocumentYaml", - "title": "%AWS.command.ssmDocument.openLocalDocumentYaml%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ssmDocument.deleteDocument", - "title": "%AWS.command.ssmDocument.deleteDocument%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ssmDocument.publishDocument", - "title": "%AWS.command.ssmDocument.publishDocument%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(cloud-upload)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ssmDocument.updateDocumentVersion", - "title": "%AWS.command.ssmDocument.updateDocumentVersion%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.copyLogResource", - "title": "%AWS.command.copyLogResource%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(files)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.cwl.searchLogGroup", - "title": "%AWS.command.cloudWatchLogs.searchLogGroup%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(search-view-icon)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.saveCurrentLogDataContent", - "title": "%AWS.command.saveCurrentLogDataContent%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(save)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.cwl.changeFilterPattern", - "title": "%AWS.command.cwl.changeFilterPattern%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(search-view-icon)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.cwl.changeTimeFilter", - "title": "%AWS.command.cwl.changeTimeFilter%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(calendar)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.addSamDebugConfig", - "title": "%AWS.command.addSamDebugConfig%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.toggleSamCodeLenses", - "title": "%AWS.command.toggleSamCodeLenses%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecs.runCommandInContainer", - "title": "%AWS.ecs.runCommandInContainer%", - "category": "%AWS.title%", - "enablement": "viewItem == awsEcsContainerNodeExecEnabled", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecs.openTaskInTerminal", - "title": "%AWS.ecs.openTaskInTerminal%", - "category": "%AWS.title%", - "enablement": "viewItem == awsEcsContainerNodeExecEnabled", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecs.enableEcsExec", - "title": "%AWS.ecs.enableEcsExec%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecs.viewDocumentation", - "title": "%AWS.generic.viewDocs%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.copyIdentifier", - "title": "%AWS.command.resources.copyIdentifier%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.openResourcePreview", - "title": "%AWS.generic.preview%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(open-preview)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.createResource", - "title": "%AWS.generic.create%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(add)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.deleteResource", - "title": "%AWS.generic.promptDelete%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.updateResource", - "title": "%AWS.generic.promptUpdate%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(pencil)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.updateResourceInline", - "title": "%AWS.generic.promptUpdate%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(pencil)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.saveResource", - "title": "%AWS.generic.save%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(save)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.closeResource", - "title": "%AWS.generic.close%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(close)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.viewDocs", - "title": "%AWS.generic.viewDocs%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(book)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.resources.configure", - "title": "%AWS.command.resources.configure%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "icon": "$(gear)", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apprunner.createService", - "title": "%AWS.command.apprunner.createService%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.ecs.disableEcsExec", - "title": "%AWS.ecs.disableEcsExec%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apprunner.createServiceFromEcr", - "title": "%AWS.command.apprunner.createServiceFromEcr%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apprunner.pauseService", - "title": "%AWS.command.apprunner.pauseService%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apprunner.resumeService", - "title": "%AWS.command.apprunner.resumeService%", - "category": "AWS", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apprunner.copyServiceUrl", - "title": "%AWS.command.apprunner.copyServiceUrl%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apprunner.open", - "title": "%AWS.command.apprunner.open%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apprunner.deleteService", - "title": "%AWS.generic.promptDelete%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.apprunner.startDeployment", - "title": "%AWS.command.apprunner.startDeployment%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.cloudFormation.newTemplate", - "title": "%AWS.command.cloudFormation.newTemplate%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.sam.newTemplate", - "title": "%AWS.command.sam.newTemplate%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.samcli.sync", - "title": "%AWS.command.samcli.sync%", - "category": "%AWS.title%", - "enablement": "isCloud9 || !aws.isWebExtHost" - }, - { - "command": "aws.toolkit.amazonq.learnMore", - "title": "%AWS.amazonq.learnMore%", - "category": "%AWS.title%" - }, - { - "command": "aws.toolkit.amazonq.extensionpage", - "title": "Open Amazon Q Extension", - "category": "%AWS.title%" - }, - { - "command": "aws.dev.openMenu", - "title": "Open Developer Menu", - "category": "AWS (Developer)", - "enablement": "aws.isDevMode" - }, - { - "command": "aws.dev.viewLogs", - "title": "Watch Logs", - "category": "AWS (Developer)" - }, - { - "command": "aws.openInApplicationComposerDialog", - "title": "%AWS.command.applicationComposer.openDialog%", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.openInApplicationComposer", - "title": "%AWS.command.applicationComposer.open%", - "category": "%AWS.title%", - "icon": { - "dark": "resources/icons/aws/applicationcomposer/icon-dark.svg", - "light": "resources/icons/aws/applicationcomposer/icon.svg" - }, - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.createNewThreatComposer", - "title": "%AWS.command.threatComposer.createNew%", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - }, - { - "command": "aws.newThreatComposerFile", - "title": "%AWS.command.threatComposer.newFile%", - "category": "%AWS.title%", - "cloud9": { - "cn": { - "category": "%AWS.title.cn%" - } - } - } - ], - "jsonValidation": [ - { - "fileMatch": ".aws/templates.json", - "url": "./dist/src/templates/templates.json" - }, - { - "fileMatch": "*ecs-task-def.json", - "url": "https://ecs-intellisense.s3-us-west-2.amazonaws.com/task-definition/schema.json" - } - ], - "languages": [ - { - "id": "asl", - "extensions": [ - ".asl.json", - ".asl" - ], - "aliases": [ - "Amazon States Language" - ] - }, - { - "id": "asl-yaml", - "aliases": [ - "Amazon States Language (YAML)" - ], - "extensions": [ - ".asl.yaml", - ".asl.yml" - ] - }, - { - "id": "ssm-json", - "extensions": [ - ".ssm.json" - ], - "aliases": [ - "AWS Systems Manager Document (JSON)" - ] - }, - { - "id": "ssm-yaml", - "extensions": [ - ".ssm.yaml", - ".ssm.yml" - ], - "aliases": [ - "AWS Systems Manager Document (YAML)" - ] - } - ], - "keybindings": [ - { - "command": "aws.previewStateMachine", - "key": "ctrl+shift+v", - "mac": "cmd+shift+v", - "when": "editorTextFocus && editorLangId == asl || editorTextFocus && editorLangId == asl-yaml" - } - ], - "grammars": [ - { - "language": "asl", - "scopeName": "source.asl", - "path": "./syntaxes/ASL.tmLanguage" - }, - { - "language": "asl-yaml", - "scopeName": "source.asl.yaml", - "path": "./syntaxes/asl-yaml.tmLanguage.json" - }, - { - "language": "ssm-json", - "scopeName": "source.ssmjson", - "path": "./syntaxes/SSMJSON.tmLanguage" - }, - { - "language": "ssm-yaml", - "scopeName": "source.ssmyaml", - "path": "./syntaxes/SSMYAML.tmLanguage" - } - ], - "resourceLabelFormatters": [ - { - "scheme": "aws-cwl", - "formatting": { - "label": "${path}", - "separator": "/" - } - }, - { - "scheme": "s3*", - "formatting": { - "label": "[S3] ${path}", - "separator": "/" - } - } - ], - "walkthroughs": [], - "icons": { - "aws-amazonq-q-gradient": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1aa" - } - }, - "aws-amazonq-q-squid-ink": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1ab" - } - }, - "aws-amazonq-q-white": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1ac" - } - }, - "aws-amazonq-transform-arrow-dark": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1ad" - } - }, - "aws-amazonq-transform-arrow-light": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1ae" - } - }, - "aws-amazonq-transform-default-dark": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1af" - } - }, - "aws-amazonq-transform-default-light": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b0" - } - }, - "aws-amazonq-transform-dependencies-dark": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b1" - } - }, - "aws-amazonq-transform-dependencies-light": { - "description": "AWS Contributed Icon", - "default": { - "fontPath": "./resources/fonts/aws-toolkit-icons.woff", - "fontCharacter": "\\f1b2" + }, + "aws-amazonq-transform-dependencies-light": { + "description": "AWS Contributed Icon", + "default": { + "fontPath": "./resources/fonts/aws-toolkit-icons.woff", + "fontCharacter": "\\f1b2" } }, "aws-amazonq-transform-file-dark": { @@ -3969,33 +1018,6 @@ "fontCharacter": "\\f1da" } } - }, - "notebooks": [ - { - "type": "aws-redshift-sql-notebook", - "displayName": "Redshift SQL notebook", - "selector": [ - { - "filenamePattern": "*.redshiftnb" - } - ] - } - ], - "customEditors": [ - { - "viewType": "threatComposer.tc.json", - "displayName": "%AWS.threatComposer.title%", - "selector": [ - { - "filenamePattern": "*.tc.json" - } - ] - } - ], - "configurationDefaults": { - "workbench.editorAssociations": { - "{git,gitlens,conflictResolution,vscode-local-history}:/**/*.tc.json": "default" - } } }, "devDependencies": {}, From 8ba7757252f1eb71ba96320666c0ce1b3968b1f5 Mon Sep 17 00:00:00 2001 From: hkobew Date: Thu, 19 Sep 2024 13:10:17 -0400 Subject: [PATCH 11/11] update changelog, fix command palette --- packages/core/package.nls.json | 2 +- packages/core/src/awsService/ec2/activation.ts | 2 +- packages/core/src/awsService/ec2/commands.ts | 4 ++-- .../Feature-754ec8b7-71ed-4be0-8f07-5eedd1e0fa12.json | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 packages/toolkit/.changes/next-release/Feature-754ec8b7-71ed-4be0-8f07-5eedd1e0fa12.json diff --git a/packages/core/package.nls.json b/packages/core/package.nls.json index 54a143bdfe..9cb68aa26c 100644 --- a/packages/core/package.nls.json +++ b/packages/core/package.nls.json @@ -127,7 +127,7 @@ "AWS.command.ec2.stopInstance": "Stop EC2 Instance", "AWS.command.ec2.rebootInstance": "Reboot EC2 Instance", "AWS.command.ec2.copyInstanceId": "Copy Instance Id", - "AWS.command.ec2.viewLogs": "View Current System Logs", + "AWS.command.ec2.viewLogs": "View Current EC2 System Logs", "AWS.command.ecr.copyTagUri": "Copy Tag URI", "AWS.command.ecr.copyRepositoryUri": "Copy Repository URI", "AWS.command.ecr.createRepository": "Create Repository...", diff --git a/packages/core/src/awsService/ec2/activation.ts b/packages/core/src/awsService/ec2/activation.ts index 25dd6d8fdb..7c0974b265 100644 --- a/packages/core/src/awsService/ec2/activation.ts +++ b/packages/core/src/awsService/ec2/activation.ts @@ -36,7 +36,7 @@ export async function activate(ctx: ExtContext): Promise { Commands.register('aws.ec2.copyInstanceId', async (node: Ec2InstanceNode) => { await copyTextCommand(node, 'id') }), - Commands.register('aws.ec2.viewLogs', async (node: Ec2InstanceNode) => { + Commands.register('aws.ec2.viewLogs', async (node?: Ec2InstanceNode) => { await openLogDocument(node) }), diff --git a/packages/core/src/awsService/ec2/commands.ts b/packages/core/src/awsService/ec2/commands.ts index a1b30cdff7..29339dbc80 100644 --- a/packages/core/src/awsService/ec2/commands.ts +++ b/packages/core/src/awsService/ec2/commands.ts @@ -64,8 +64,8 @@ export async function copyInstanceId(instanceId: string): Promise { await copyToClipboard(instanceId, 'Id') } -export async function openLogDocument(node: Ec2InstanceNode): Promise { - const uri = ec2LogSchema.form(node.toSelection()) +export async function openLogDocument(node?: Ec2InstanceNode): Promise { + const uri = ec2LogSchema.form(await getSelection(node)) const doc = await vscode.workspace.openTextDocument(uri) await vscode.window.showTextDocument(doc, { preview: false }) await vscode.languages.setTextDocumentLanguage(doc, 'log') diff --git a/packages/toolkit/.changes/next-release/Feature-754ec8b7-71ed-4be0-8f07-5eedd1e0fa12.json b/packages/toolkit/.changes/next-release/Feature-754ec8b7-71ed-4be0-8f07-5eedd1e0fa12.json new file mode 100644 index 0000000000..fe92aefce4 --- /dev/null +++ b/packages/toolkit/.changes/next-release/Feature-754ec8b7-71ed-4be0-8f07-5eedd1e0fa12.json @@ -0,0 +1,4 @@ +{ + "type": "Feature", + "description": "provide view of ec2 system logs" +}