aws-ec2-ssh icon indicating copy to clipboard operation
aws-ec2-ssh copied to clipboard

Add an option to override/customize clean_iam_username function

Open hmeltaus opened this issue 8 years ago • 4 comments

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.

hmeltaus avatar Aug 21 '17 13:08 hmeltaus

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 @ ?

michaelwittig avatar Aug 24 '17 11:08 michaelwittig

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.

hmeltaus avatar Aug 24 '17 12:08 hmeltaus

might related #126

michaelwittig avatar May 14 '18 11:05 michaelwittig

+1 for this. anyone done anything with it? be good to have an option to drop everything from/inc @->

davehewy avatar Aug 09 '18 10:08 davehewy