tilfinltd / aws-extend-switch-roles

Extend your AWS IAM switching roles by Chrome extension, Firefox add-on, or Edge add-on
https://goo.gl/0QFjow
MIT License
1.31k stars 140 forks source link

Feature Request: feature to assign a regex to auto-set to specific role when trying to navigate to an aws url that matches the specified regex. #345

Open jaychang99 opened 3 weeks ago

jaychang99 commented 3 weeks ago

Is your feature request related to a problem? Please describe.

This is not necessarily a problem, but I sometimes think automatically setting the role when navigating to specific url would be awesome.

For example, an aws console url as follows is always accessible under a specific role (Let's call this role A).

https://us-east-1.console.aws.amazon.com/cloudfront/v4/home?region=us-east-1#/distributions/ABCDEFGH

So whenever I am trying to navigate to a url matching

^us-east-1\.console\.aws\.amazon\.com\/cloudfront.*ABCDEFGH

It would be awesome if AESR can pre-set the role to role A before navigating to this page. (or if this is not feasible, maybe even shortly after arriving on the page?)

Describe the solution you'd like

Perhaps we could try adding a regex field (or something similar to this) for every role in configuration page?

[role-a]
role_arn = arn:aws:iam::12345678:role/john-doe@email.com
color = ff3f3f
region = us-east-1
regex: ^us-east-1\.console\.aws\.amazon\.com\/cloudfront.*ABCDEFGH <<<< LIKE THIS?

Describe alternatives you've considered

This feature does not have to be implemented directly inside this extension. Maybe AESR can just offer an external API for other extensions to set 'role' through this extension.

There's already an external API for adding configuration, so maybe another extension for letting other extensions to set role via this extension?

Additional context

Add any other context or screenshots about the feature request here.

Thanks in advance 🙂

+++ EDIT +++

Maybe regex field could accept an array of strings to accommodate multiple urls