Skip to content

Conversation

@Hweinstock
Copy link
Contributor

@Hweinstock Hweinstock commented Sep 19, 2024

Problem

Limited ability to diagnose problems with EC2 instances provided in the toolkit.

Solution

Add a right click option to provide system log of Ec2 instance in read-only file view.

Implementation Details

  • Log view does NOT live update. This would require refactoring the CWL significantly. Better to get the feature out and see if this is something customers want/need.
  • To reduce code duplication two new utility components were added decodeBase64 incore/src/shared/utilities/textUtilities.ts and UriSchema in core/src/shared/utilities/uriUtils.ts.
  • decodeBase64 is a helper function to wrap the use of Buffer.from(X, "base64").toString() throughout the toolkit.
  • UriSchema provides a general framework for translating between an object and an URI, and vice versa. It allows us to avoid writing the isValid method in all cases. With more work this could likely be more general, but is only used twice so unclear if it is worth pursuing.
  • These changes involved changing some function calls, especially in the CWL code, but does not impact functionality.

Pictures

image image

License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions
Copy link

This pull request implements a feature or fix, so it must include a changelog entry. See CONTRIBUTING.md#changelog for instructions.

@Hweinstock Hweinstock changed the title feat(ec2): provide link for customer to view system logs (WIP)feat(ec2): provide link for customer to view system logs Sep 19, 2024
@Hweinstock Hweinstock changed the title (WIP)feat(ec2): provide link for customer to view system logs feat(ec2): provide link for customer to view system logs Sep 19, 2024
@Hweinstock Hweinstock marked this pull request as ready for review September 19, 2024 18:36
@Hweinstock Hweinstock requested a review from a team as a code owner September 19, 2024 18:36
@justinmk3
Copy link
Contributor

justinmk3 commented Oct 16, 2024

LGTM after CI passes :)

cc @keeganirby for visibility.

Related: this upcoming feature-branch enhances packages/core/src/shared/awsConsole.ts to support any(?) resource/service.

Copy link
Contributor

@justinmk3 justinmk3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Hweinstock Hweinstock merged commit ed323d7 into master Oct 18, 2024
23 of 24 checks passed
@Hweinstock Hweinstock deleted the hkobew/ec2/cwl branch October 18, 2024 20:44
tverney pushed a commit to tverney/aws-toolkit-vscode that referenced this pull request Oct 21, 2024
## Problem
Limited ability to diagnose problems with EC2 instances provided in the
toolkit.

## Solution
Add a right click option to provide system log of Ec2 instance in
read-only file view.
### Implementation Details
- Log view does NOT live update. This would require refactoring the CWL
significantly. Better to get the feature out and see if this is
something customers want/need.
- To reduce code duplication two new utility components were added
`decodeBase64` in`core/src/shared/utilities/textUtilities.ts` and
`UriSchema` in `core/src/shared/utilities/uriUtils.ts`.
- `decodeBase64` is a helper function to wrap the use of `Buffer.from(X,
"base64").toString()` throughout the toolkit.
- `UriSchema` provides a general framework for translating between an
object and an URI, and vice versa. It allows us to avoid writing the
`isValid` method in all cases. With more work this could likely be more
general, but is only used twice so unclear if it is worth pursuing.
- These changes involved changing some function calls, especially in the
CWL code, but does not impact functionality.
### Pictures 
<img width="1231" alt="image"
src="https://github.com/user-attachments/assets/0991c51e-6e27-4102-a85f-08246a7faab0">
<img width="1508" alt="image"
src="https://github.com/user-attachments/assets/558d831f-7a7c-475b-9400-719ce8fd99d7">


---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: Justin M. Keyes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants