rkoval / alfred-aws-console-services-workflow

A powerful workflow for quickly opening up AWS Console Services in your browser or searching for entities within them.
MIT License
312 stars 54 forks source link

Use profile different than default #29

Closed newza-fullmetal closed 3 years ago

newza-fullmetal commented 3 years ago

Hi, I would like to use this workflow to administrate our infrastructure. But it does not match our need because we do not have only one profile but at least 3 like :

Can we imagine a way to switch between profile before to use a command like : aws go prod -> switch the profile to prod Or a way to specify it in the request : aws prod ec2 instances plop

I am openned to participate to this feature.

rkoval commented 3 years ago

unfortunately, there is not yet any functionality to switch profiles on the fly. however, as a workaround, you can potentially just install multiple versions of this workflow that are each configured to utilize a different profile and prefix. have a look at this comment for more details. i have not tested this myself, and it is somewhat of a hack, but it seems like there has been some success doing it this way

newza-fullmetal commented 3 years ago

Thank you I will give it a try :)

newza-fullmetal commented 3 years ago

Ok It is working but partially for example : if I go to the loggroups of a lambda in dev with the aws command it oppens me my browser with my last active session (preprod). I do not know if it is possible to work around this one

MacHu-GWU commented 3 years ago

@rkoval I recommend to create a command like: aws setprofile. Then it parse the ~/.aws/credential file and give the availalbe profile list. Then you can persist the value in a file like ~/.alfred-workflow-aws/current_profile.txt. Then in your workflow, try to load profile from the .txt file, if failed, use the default profile.

rkoval commented 3 years ago

splitting this issue into https://github.com/rkoval/alfred-aws-console-services-workflow/issues/36 and https://github.com/rkoval/alfred-aws-console-services-workflow/issues/37. i'll look into adding proper support for these soon-ish™