Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial functionality #9

Merged
merged 48 commits into from
Mar 24, 2022
Merged

Initial functionality #9

merged 48 commits into from
Mar 24, 2022

Conversation

dav3r
Copy link
Member

@dav3r dav3r commented Mar 10, 2022

πŸ—£ Description

The PR provides the initial functionality of this project, a script that simplifies the process of opening sessions to AWS instances using SSM, either with or without SSH, and includes helpful tab autocompletion of various parameters on the command line.

πŸ’­ Motivation and context

There are two main benefits to using this tool:

  • The command to open a session is much simpler than without it.
  • There is no need to separately look up the ID of the AWS instance you want to connect to, since the tab completion in this tool does it for you.

If you need to connect to many different AWS instances across multiple AWS accounts via the CLI, this tool will save you a bunch of time.

Note that since this repository/module supports non-SSH connections, @felddy and I discussed the pros and cons of renaming it (and appropriately adjusting the argument names and related code), but we ultimately agreed that "awssh" could refer to opening any shell via AWS. Also, it seemed like extra work for minimal benefits.

πŸ§ͺ Testing

I verified that the basic functionality all works as intended and all automated tests pass.

βœ… Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

βœ… Post-merge checklist

  • Add a tag or create a release.

felddy and others added 30 commits July 13, 2021 14:01
This is the first commit of a working utility.
It still has a bunch of TODOs.
 - Functions need docs
 - Better README
 - Clean up logging.
 - Ton of linter errors
 - Many more
Renamed the competer tool so that bash would not offer it
as a completion when typing awssh<tab>
This was requested by @dav3r

It is a bit of a weird case, where the current word doesn't match
any candidate.
Also, update keywords from skeleton template and delete unused package_data line
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Strong work from all involved. I mostly have some housekeeping change requests.

src/awssh/__init__.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/awssh/autocompleter.py Outdated Show resolved Hide resolved
src/awssh/autocompleter.py Outdated Show resolved Hide resolved
src/awssh/autocompleter.py Outdated Show resolved Hide resolved
src/awssh/autocompleter.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
dav3r and others added 8 commits March 11, 2022 15:32
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
Co-Authored-By: Nick <mcdonnnj@users.noreply.github.com>
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
src/awssh/autocompleter.py Outdated Show resolved Hide resolved
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
src/awssh/autocompleter.py Outdated Show resolved Hide resolved
dav3r and others added 4 commits March 11, 2022 16:12
This is in line with our standard of only specifying a return code if there is an error.

Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
Co-Authored-By: Nick <mcdonnnj@users.noreply.github.com>
This enables cleaner class initialization code.

Co-Authored-By: Nick <mcdonnnj@users.noreply.github.com>
@dav3r dav3r requested review from mcdonnnj and jsf9k March 14, 2022 19:07
Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

Approval intensifies

Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Thanks for your continued work on getting this out the door! I had some mypy related items that I missed on my initial review I would like resolved.

setup.py Outdated Show resolved Hide resolved
src/awssh/awssh.py Show resolved Hide resolved
dav3r and others added 2 commits March 16, 2022 15:10
We override the default flags in order to exclude the --ignore-missing-imports flag.  As a result of that, we add some additional dependencies needed to successfully do type-checking.

Co-Authored-By: Nick <mcdonnnj@users.noreply.github.com>
Since these packages are not required for the tool to function, they do not belong in the install_requires section.

Co-Authored-By: Nick <mcdonnnj@users.noreply.github.com>
@dav3r dav3r requested review from mcdonnnj and jsf9k March 16, 2022 21:16
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Just one more mypy dependency but otherwise LGTM βœ” Thanks for your work getting this over the finish line πŸ’ͺπŸ’ͺπŸ’ͺ

setup.py Show resolved Hide resolved
Co-authored-by: Nick <50747025+mcdonnnj@users.noreply.github.com>
@dav3r dav3r merged commit 0947c7c into develop Mar 24, 2022
@dav3r dav3r deleted the first-commits branch March 24, 2022 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add or improve functionality, maintainability, or ease of use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants