Commit e46500e
authored
fix(logs): avoid logging EC2 ARN on commands #6152
## Problem
The EC2 ARN sneaks its away into the logs via the `Ec2InstanceNode`
tooltip property from
`packages/core/src/awsService/ec2/explorer/ec2InstanceNode.ts`. When we
run any command on this instance, we get the following logs with the
middle section omitted for brevity.
```
2024-12-04 17:25:10.859 [debug] command: running "aws.ec2.openTerminal" with arguments: [
{
collapsibleState: 0,
label: 'testInstance ({INSTANCE_ID}) RUNNING',
...
contextValue: 'awsEc2RunningNode',
iconPath: { id: 'pass', color: undefined },
tooltip: 'testInstance\n' +
'{INSTANCE_ID}\n' +
'running\n' +
'arn:aws:ec2:us-east-1:{ACCOUNT_ID}:instance/{INSTANCE_ID}',
id: '{INSTANCE_ID}'
},
undefined
]
```
The actual AWS account ID in use is included in the logs.
What makes this difficult is that this node is passed directly from
VSCode here:
https://github.com/aws/aws-toolkit-vscode/blob/d74f96c61f79716edf8a9a706a86c587887d3b9b/packages/core/src/awsService/ec2/activation.ts#L32-L37
and is processed by our commands wrapper here:
https://github.com/aws/aws-toolkit-vscode/blob/d74f96c61f79716edf8a9a706a86c587887d3b9b/packages/core/src/shared/vscode/commands2.ts#L649-L660
The wrapper is logging the node directly from vscode, not giving us a
chance to use `partialClone` on it first.
## Solution
- omit all tooltips from the logs, since this is usually redundant
information anyway.1 parent 7fe8a25 commit e46500e
File tree
1 file changed
+1
-1
lines changed1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
| 659 | + | |
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| |||
0 commit comments