Add granted sso populate/generate commands#230
Conversation
f6ea45a to
adf821a
Compare
adf821a to
95d5c60
Compare
How does it resolve conflicts? |
Conflicting old profiles are replaced by the new ones derived from SSO. |
JoshuaWilkes
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
This all looks good to me, we will get a few extra eyes on it then I think we can get it merged in for the next release. 🚀
@JoshuaWilkes Great, thank you! Please drop me a mention if the review yields any change requests, as it's easier for me to see those notifications. :) |
chrnorm
left a comment
There was a problem hiding this comment.
@misterjoshua this is fantastic, welcome to the Common Fate community and thankyou so much for the contribution here!
The code changes look good, I also asked the community Slack for some feedback on these changes. A couple of members have shared details on how they are templating their ~/.aws/config files. I've opened a discussion so that we have a thread to track further improvements on this and added their use cases to it: #249. I'm expecting that this will be an ongoing discussion thread on how we can make things easier when it comes to config file management, so will be good to have things in one place to refer to.
This change introduces two new
grantedcommands to help users manage their AWS Config with accounts and roles found through AWS SSO:granted sso generate [--prefix <prefix>] [--region <region>] <start url>This command finds a list of accounts and roles available in AWS SSO and outputs an AWS Config with generated profile names and SSO configurations to the standard output. This is useful for users who want to copy and paste or post-process the generated AWS Config.
This command allows the user to specify an optional
--prefixso that the generated profile names begin with the given prefix, reducing profile naming conflicts for users who must regularly log into many different SSOs. This command also allows the user to specify the region in which AWS SSO is deployed with--region.granted sso populate [--prefix <prefix>] [--region <region>] <start url>Similar to
granted sso generate, this command finds a list of accounts and roles available in AWS SSO, but after, it merges the profiles into the user's existing AWS Config file, replacing conflicting old profiles with new profiles.Fixes #173