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

[Feature Request] Ability to define command aliases per-profiles. #234

Open
ToMMy86 opened this issue Oct 22, 2019 · 0 comments
Open

[Feature Request] Ability to define command aliases per-profiles. #234

ToMMy86 opened this issue Oct 22, 2019 · 0 comments

Comments

@ToMMy86
Copy link

ToMMy86 commented Oct 22, 2019

Hello, i'm trying it out the aws-shell in my environment but i found that the Os shell commands ( !.. )
are not honoring my environment aliases. Bash or ZSH defined aliases for example.

Before aws-shell, years ago, I've writed myself a simple custom bash/zsh profile applied to a common centos-vm witch was a simple wrapper around aws-cli, enabling to switch between accounts ( export all the variables needed for awscli and a bunch of custom defined ones enabling some functionalities binded to the profile one's connecting to ) .. since now ...my team is using this simple approach to administer aws from the cli --> ssh@"awsconsole vm" with own AD username ... the profile script asks on login where to connect on aws-side, reading a list of pre-configured aws-profiles --> user inputs VPCNAME, role, IAM Creds, region etc... --> the wrapper exports the Environment Variables needed... and presents the shell ( the OS bash or zsh ) with aws-cli enabled and ready to work. Also swith between profiles is possible.

So long story short... i really would like to use aws-shell and get rid of my old solution... but there is a missing feature, really really usefull in my opinion ... the ability to specify custom commands per-aws profiles. ( aliases ...)

THE PROPOSAL

Why not use the dot command ".alias" --> opens the editor similar to .editor .. and be able to specify :

ALIASNAME="shell command pipeline"
ALIASNAME="Another cool command" 

This should be saved ( maybe ) inside ~/.aws/shell/aliases/ with the format CURRENTPROFILE.aliases

This way also would be an OS agnostic configuration..

The expected behaviour should be that when "aws-shell --profile WHATEVER" opens
it loads the aliases corresponding to the profile you are connecting to, and when using the !COMMAND feature it resolves the defined correspondings.
If a command is present, with the same name, in Os shell and alias definition.. the alias definited INSIDE aws-shell should take precedence... ( Override .. just like it is in plain bash/zsh )

So for example... if i define for profile "COMPANY01" the aliases ( Just using the .alias dot-command inside the aws-shell ):

ssh="ssh -Y -i /company01-aws-keys/$(echo whoami).pem " 

inside the aws-shell:

!ssh  centos@instance-name    -->  works as expected and also the configuration is portable from the aws-shell prospective.

Just a simple example... the ability to extend the aws-shell with custom PER-Profile aliases/overrides/custom-commands would be awsome.

@ToMMy86 ToMMy86 changed the title [Feature Request] Ability to define alias per profile. [Feature Request] Ability to define command aliased per-profiles. Oct 22, 2019
@ToMMy86 ToMMy86 changed the title [Feature Request] Ability to define command aliased per-profiles. [Feature Request] Ability to define command aliases per-profiles. Oct 22, 2019
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

No branches or pull requests

1 participant