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

Support tags in ListFields #529

Open
Moulick opened this issue Aug 15, 2023 · 7 comments
Open

Support tags in ListFields #529

Moulick opened this issue Aug 15, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@Moulick
Copy link

Moulick commented Aug 15, 2023

Is your feature request related to a problem? Please describe

Having the tags in aws-sso list would be helpful 😄

Describe the solution you'd like

Support Account/Role tags in ListFields

AccountName          | AccountAlias | AccountIdPad | Expires | Profile               | RoleName    |  Tags                     
===============================================================================================================================
company-a-production | c-12334-prod | 123456789123 | 59m     | 123456789123:ReadOnly | c-Developer | team:team-a,type:internal
@Moulick Moulick added the enhancement New feature or request label Aug 15, 2023
@synfinatic
Copy link
Owner

Yeah I've been thinking about this myself. The thing that I don't have a good handle on is that roles can have lots of tags and I don't want the list command to only be useful on 5K wide screen monitors. How to keep this manageable? Any thoughts?

@PacoVK
Copy link
Contributor

PacoVK commented Aug 16, 2023

Maybe, make this column optional. The user can decide whether this info is helpful/ useful depending on the amount of tag that are used.
Another option is to filter tags, eg. you could specify the tag keys to be included in the config.yml. This way the user can sort out any technical/ standart tags
WDYT?

@Moulick
Copy link
Author

Moulick commented Aug 16, 2023

We could probably support sprig as in ProfileFormat where then the user could define {{ .Tags.xyz }}, or only show the tags mentioned in AccountPrimaryTag ?

@synfinatic
Copy link
Owner

So is the general consensus that <name>:<value> the correct output format?

@Moulick: What would {{ .Tags.xyz }} output?

@Moulick
Copy link
Author

Moulick commented Aug 21, 2023

I take back {{ .Tags.xyz}}, that was a bad suggestion. I am now thinking something like (minimal config)

SSOConfig:
  Default:
    Accounts:
      123456789123:
        Name: company-a-production
        Tags:
          team: team-a
          type: internal  

ProfileFormat: "{{ coalesce .AccountName .AccountIdPad }}:{{ .RoleName }}"

AccountPrimaryTag:
  - env

ListFields:
  - AccountName
  - Tags
    - team
    - type
  - AccountAlias
  - AccountIdPad
  # - Arn
  - Expires
  - Profile
  - RoleName

will produce

❯ aws-sso list
List of AWS roles for SSO Instance: Default [Expires in: 7h 22m]

AccountName          |  Tags                      | AccountAlias | AccountIdPad | Expires | Profile               | RoleName    
================================================================================================================================
company-a-production | team:team-a, type:internal | c-12334-prod | 123456789123 | 59m     | 123456789123:ReadOnly | c-Developer 

@Moulick
Copy link
Author

Moulick commented Aug 21, 2023

If you wish, I can hack together an initial draft for the PR?

@synfinatic
Copy link
Owner

I really like that idea @Moulick. Would love to see you give it a go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants