|
5 | 5 | import { ExtContext } from '../shared/extensions'
|
6 | 6 | import { Commands } from '../shared/vscode/commands2'
|
7 | 7 | import { telemetry } from '../shared/telemetry/telemetry'
|
8 |
| -import { Ec2InstanceNode } from './explorer/ec2InstanceNode' |
9 |
| -import { promptUserForEc2Selection } from './prompter' |
10 |
| -import { Ec2ConnectionManager } from './model' |
| 8 | +import { Ec2Node } from './explorer/ec2ParentNode' |
| 9 | +import { openRemoteConnection, openTerminal } from './commands' |
11 | 10 |
|
12 | 11 | export async function activate(ctx: ExtContext): Promise<void> {
|
13 | 12 | ctx.extensionContext.subscriptions.push(
|
14 |
| - Commands.register('aws.ec2.openTerminal', async (node?: Ec2InstanceNode) => { |
| 13 | + Commands.register('aws.ec2.openTerminal', async (node?: Ec2Node) => { |
15 | 14 | await telemetry.ec2_connectToInstance.run(async span => {
|
16 | 15 | span.record({ ec2ConnectionType: 'ssm' })
|
17 |
| - const selection = node ? node.toSelection() : await promptUserForEc2Selection() |
18 |
| - |
19 |
| - const connectionManager = new Ec2ConnectionManager(selection.region) |
20 |
| - await connectionManager.attemptToOpenEc2Terminal(selection) |
| 16 | + await (node ? openTerminal(node) : openTerminal(node)) |
21 | 17 | })
|
22 | 18 | }),
|
23 | 19 |
|
24 |
| - Commands.register('aws.ec2.openRemoteConnection', async (node?: Ec2InstanceNode) => { |
25 |
| - const selection = node ? node.toSelection() : await promptUserForEc2Selection() |
26 |
| - //const connectionManager = new Ec2ConnectionManager(selection.region) |
27 |
| - console.log(selection) |
| 20 | + Commands.register('aws.ec2.openRemoteConnection', async (node?: Ec2Node) => { |
| 21 | + await (node ? openRemoteConnection(node) : openRemoteConnection(node)) |
28 | 22 | })
|
29 | 23 | )
|
30 | 24 | }
|
0 commit comments