Well, I was commenting on the failure to match an instance type. I know it's a minor point, but leaving that block of code in there will cause future people reading this code to think that it's possible for the string in 'type' to not match any InstanceType enumerators, but that's not possible.

And yes, you are right about the use of name() instead of toString(). I think I'd prefer to use toString() instead (since it provides the same instance type strings that users see in the AWS console and other places), but that's  a larger change that would require configuration conversion, so not appropriate for this patch.