docs: def _convert_definition(self, definition, ref=None, cls=None):
          """
          Converts any object to its troposphere equivalent, if applicable.
          This function will recurse into lists and mappings to create
          additional objects as necessary.
  
          :param {*} definition: Object to convert
          :param str ref: Name of key in parent dict that the provided definition
                          is from, can be None
          :param type cls: Troposphere class which represents provided definition
          """
          if isinstance(definition, Mapping):
              if 'Type' in definition:  # this is an AWS Resource
                  expected_type = None
                  if cls is not None:
                      expected_type = cls
                  else:
                      # if the user uses the custom way to name custom resources,
                      # we'll dynamically create a new subclass for this use and
                      # pass that instead of the typical CustomObject resource
                      try:
                          expected_type = self._generate_custom_type(
                              definition['Type'])
                      except TypeError:
                          # If definition['Type'] turns out not to be a custom
                          # type (aka doesn't start with "Custom::")
                          if ref is not None:
                              raise ResourceTypeNotFound(ref, definition['Type'])
                          else:
                              # Make sure expected_type is nothing (as
                              # it always should be)
                              assert not expected_type
  
                  if expected_type:
                      args = self._normalize_properties(definition)
                      return self._create_instance(expected_type, args, ref)
  
              if len(definition) == 1:  # This might be a function?
                  function_type = self._get_function_type(
                      definition.keys()[0])
                  if function_type:
                      return self._create_instance(
                          function_type, definition.values()[0])
  
              # nothing special here - return as dict
              d = {}
              for k, v in definition.iteritems():
                  d[k] = self._convert_definition(v)
              return d
  
          elif (isinstance(definition, Sequence) and
                  not isinstance(definition, basestring)):
              return [self._convert_definition(v) for v in definition]
  
          # anything else is returned as-is
          return definition