refactor(logs): avoid logging EC2 ARN on commands. #6152
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The EC2 ARN sneaks its away into the logs via the
Ec2InstanceNodetooltip property frompackages/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.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:
aws-toolkit-vscode/packages/core/src/awsService/ec2/activation.ts
Lines 32 to 37 in d74f96c
and is processed by our commands wrapper here:
aws-toolkit-vscode/packages/core/src/shared/vscode/commands2.ts
Lines 649 to 660 in d74f96c
The wrapper is logging the node directly from vscode, not giving us a chance to use
partialCloneon it first.Solution
feature/xbranches will not be squash-merged at release time.License: I confirm that my contribution is made under the terms of the Apache 2.0 license.