Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
018d719
run branch check on PRs only
Hweinstock Dec 9, 2024
d03a2da
use event branch name
Hweinstock Dec 9, 2024
4fb8e66
change wording
Hweinstock Dec 9, 2024
cdecab6
add extra check
Hweinstock Dec 9, 2024
f2900e5
switch to single quotes
Hweinstock Dec 9, 2024
902de77
Merge branch 'aws:master' into master
Hweinstock Dec 9, 2024
bf03fd3
Merge branch 'aws:master' into master
Hweinstock Dec 10, 2024
4cd5400
Merge branch 'aws:master' into master
Hweinstock Dec 10, 2024
0234303
Merge branch 'aws:master' into master
Hweinstock Dec 11, 2024
b603c33
add as experiment
Hweinstock Dec 12, 2024
0c643ec
update description
Hweinstock Dec 12, 2024
f4729ec
re-update package.json
Hweinstock Dec 12, 2024
9a23d7b
change wording
Hweinstock Dec 12, 2024
c1f8c10
add period
Hweinstock Dec 12, 2024
b3fc10e
add changelog
Hweinstock Dec 12, 2024
f988458
Merge branch 'aws:master' into master
Hweinstock Dec 12, 2024
bc62d3e
Merge branch 'master' into ec2/experiment
Hweinstock Dec 12, 2024
9ff9faa
manually update
Hweinstock Dec 12, 2024
fab0d88
undo changes to package files
Hweinstock Dec 12, 2024
54be0b3
Merge branch 'aws:master' into master
Hweinstock Dec 12, 2024
2e43850
Merge branch 'master' into ec2/experiment
Hweinstock Dec 12, 2024
7e08dc1
move copy to be with other ec2 commands
Hweinstock Dec 12, 2024
4d3831a
remove async await in when clause
Hweinstock Dec 12, 2024
e283b35
Update packages/toolkit/.changes/next-release/Feature-6cca02fc-98d3-4…
Hweinstock Dec 12, 2024
501e356
remove unneeded await in the tests
Hweinstock Dec 12, 2024
e32d43e
Merge branch 'ec2/experiment' of github.com:Hweinstock/aws-toolkit-vs…
Hweinstock Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"AWS.configuration.description.suppressPrompts": "Prompts which ask for confirmation. Checking an item suppresses the prompt.",
"AWS.configuration.enableCodeLenses": "Enable SAM hints in source code and template.yaml files",
"AWS.configuration.description.resources.enabledResources": "AWS resources to display in the 'Resources' portion of the explorer.",
"AWS.configuration.description.experiments": "Try experimental features and give feedback. Note that experimental features may be removed at any time.\n * `jsonResourceModification` - Enables basic create, update, and delete support for cloud resources via the JSON Resources explorer component.\n * `samSyncCode` - Adds an additional code-only option when synchronizing SAM applications. Code-only synchronizations are faster but can cause drift in the CloudFormation stack. Does nothing when using the legacy SAM deploy feature.\n * `iamPolicyChecks` - Enables IAM Policy Checks feature, allowing users to validate IAM policies against IAM policy grammar, AWS best practices, and specified security standards.",
"AWS.configuration.description.experiments": "Try experimental features and give feedback. Note that experimental features may be removed at any time.\n * `jsonResourceModification` - Enables basic create, update, and delete support for cloud resources via the JSON Resources explorer component.\n * `ec2RemoteConnect` - Allows interfacing with EC2 instances with options to start, stop, and establish remote connections. Remote connections are done over SSM and can be through a terminal or a remote VSCode window.",
"AWS.stepFunctions.asl.format.enable.desc": "Enables the default formatter used with Amazon States Language files",
"AWS.stepFunctions.asl.maxItemsComputed.desc": "The maximum number of outline symbols and folding regions computed (limited for performance reasons).",
"AWS.configuration.description.awssam.debug.api": "API Gateway configuration",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/awsexplorer/regionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import { DefaultSchemaClient } from '../shared/clients/schemaClient'
import { getEcsRootNode } from '../awsService/ecs/model'
import { compareTreeItems, TreeShim } from '../shared/treeview/utils'
import { Ec2ParentNode } from '../awsService/ec2/explorer/ec2ParentNode'
import { DevSettings } from '../shared/settings'
import { Ec2Client } from '../shared/clients/ec2Client'
import { isCloud9 } from '../shared/extensionUtilities'
import { Experiments } from '../shared/settings'

interface ServiceNode {
allRegions?: boolean
Expand Down Expand Up @@ -65,7 +65,7 @@ const serviceCandidates: ServiceNode[] = [
},
{
serviceId: 'ec2',
when: () => DevSettings.instance.isDevMode(),
when: () => Experiments.instance.isExperimentEnabled('ec2RemoteConnect'),
createFn: (regionCode: string, partitionId: string) =>
new Ec2ParentNode(regionCode, partitionId, new Ec2Client(regionCode)),
},
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/shared/settings-toolkit.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export const toolkitSettings = {
"ssoCacheError": {}
},
"aws.experiments": {
"jsonResourceModification": {}
"jsonResourceModification": {},
"ec2RemoteConnect": {}
},
"aws.resources.enabledResources": {},
"aws.lambda.recentlyUploaded": {},
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/shared/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,12 +726,12 @@ export class Experiments extends Settings.define(
'aws.experiments',
toRecord(keys(experiments), () => Boolean)
) {
public async isExperimentEnabled(name: ExperimentName): Promise<boolean> {
public isExperimentEnabled(name: ExperimentName): boolean {
try {
return this._getOrThrow(name, false)
} catch (error) {
this._log(`experiment check for ${name} failed: %s`, error)
await this.reset()
this.reset().catch((e) => getLogger().error(`failed to reset experiment settings: %O`, e))

return false
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "New experimental feature EC2 Remote connect."
}
53 changes: 29 additions & 24 deletions packages/toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,17 @@
"type": "object",
"markdownDescription": "%AWS.configuration.description.experiments%",
"default": {
"jsonResourceModification": false
"jsonResourceModification": false,
"ec2RemoteConnect": false
},
"properties": {
"jsonResourceModification": {
"type": "boolean",
"default": false
},
"ec2RemoteConnect": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false
Expand Down Expand Up @@ -1203,27 +1208,27 @@
},
{
"command": "aws.ec2.openRemoteConnection",
"when": "aws.isDevMode"
"when": "config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.openTerminal",
"when": "aws.isDevMode"
"when": "config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.linkToLaunch",
"when": "aws.isDevMode"
"when": "config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.startInstance",
"when": "aws.isDevMode"
"when": "config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.stopInstance",
"when": "aws.isDevMode"
"when": "config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.rebootInstance",
"when": "aws.isDevMode"
"when": "config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.dev.openMenu",
Expand Down Expand Up @@ -1448,62 +1453,67 @@
{
"command": "aws.ec2.openTerminal",
"group": "0@1",
"when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/"
"when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/ && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.openTerminal",
"group": "inline@1",
"when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/"
"when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/ && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.linkToLaunch",
"group": "0@1",
"when": "viewItem =~ /^(awsEc2ParentNode)$/"
"when": "viewItem =~ /^(awsEc2ParentNode)$/ && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.linkToLaunch",
"group": "inline@1",
"when": "viewItem =~ /^(awsEc2ParentNode)$/"
"when": "viewItem =~ /^(awsEc2ParentNode)$/ && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.openRemoteConnection",
"group": "0@1",
"when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/"
"when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/ && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.openRemoteConnection",
"group": "inline@1",
"when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/"
"when": "viewItem =~ /^(awsEc2(Parent|Running)Node)$/ && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.startInstance",
"group": "0@1",
"when": "viewItem == awsEc2StoppedNode"
"when": "viewItem == awsEc2StoppedNode && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.startInstance",
"group": "inline@1",
"when": "viewItem == awsEc2StoppedNode"
"when": "viewItem == awsEc2StoppedNode && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.stopInstance",
"group": "0@1",
"when": "viewItem == awsEc2RunningNode"
"when": "viewItem == awsEc2RunningNode && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.stopInstance",
"group": "inline@1",
"when": "viewItem == awsEc2RunningNode"
"when": "viewItem == awsEc2RunningNode && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.rebootInstance",
"group": "0@1",
"when": "viewItem == awsEc2RunningNode"
"when": "viewItem == awsEc2RunningNode && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.rebootInstance",
"group": "inline@1",
"when": "viewItem == awsEc2RunningNode"
"when": "viewItem == awsEc2RunningNode && config.aws.experiments.ec2RemoteConnect"
},
{
"command": "aws.ec2.copyInstanceId",
"when": "view == aws.explorer && viewItem =~ /^(awsEc2(Running|Stopped|Pending)Node)$/ && config.aws.experiments.ec2RemoteConnect",
"group": "2@0"
},
{
"command": "aws.ecr.createRepository",
Expand Down Expand Up @@ -1605,11 +1615,6 @@
"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(Running|Stopped|Pending)Node)$/",
"group": "2@0"
},
{
"command": "aws.ecr.copyTagUri",
"when": "view == aws.explorer && viewItem == awsEcrTagNode",
Expand Down
Loading