Support tags in ListFields
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
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?
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?
We could probably support sprig as in ProfileFormat where then the user could define {{ .Tags.xyz }}, or only show the tags mentioned in AccountPrimaryTag ?
So is the general consensus that <name>:<value> the correct output format?
@Moulick: What would {{ .Tags.xyz }} output?
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
If you wish, I can hack together an initial draft for the PR?
I really like that idea @Moulick. Would love to see you give it a go!