def resource_type_from_id(context, resource_id):
 known_types = {'i': 'instance', 'r': 'reservation', 'vol': 'volume', 'snap': 'snapshot', 'ami': 'image', 'aki': 'image', 'ari': 'image'}
 type_marker = resource_id.split('-')[0]
 return known_types.get(type_marker)

def resource_type_from_id ( context , resource_id ) : known_types = { 'i' : 'instance' , 'r' : 'reservation' , 'vol' : 'volume' , 'snap' : 'snapshot' , 'ami' : 'image' , 'aki' : 'image' , 'ari' : 'image' } type_marker = resource_id . split ( '-' ) [ 0 ] return known_types . get ( type_marker )
get resource type by id returns a string representation of the amazon resource type .