aws-ec2-ssh
aws-ec2-ssh copied to clipboard
Add an option to override/customize clean_iam_username function
We use email addresses as IAM usernames, but these can easily be longer than 32 chars. The current implementation of clean_iam_username makes them even longer.
It would be great if we could provide our custom function that would be invoked instead of clean_iam_username.
The custom function could be provided in /etc/aws-ec2-ssh.conf file, or maybe in some separate file.
Hi @hmeltaus How would your custom implementation look like? E.g. we could also handle the case of email addresses and remove everything after the @ ?
Removing everything after the @ would certainly work in most cases.
I guess you'd need to introduce a new option in configuration file which would enable this feature. Maybe that same option could be later used to tell that a custom function should be used to process IAM usernames if the default cleaning or email domain stripping isn't enough.
Anyway, having an option to remove everything after @ is just what we need at the moment.
might related #126
+1 for this. anyone done anything with it? be good to have an option to drop everything from/inc @->