code: def resource_exists(resource, name=None, resource_id=None, tags=None,
                      region=None, key=None, keyid=None, profile=None):
      '''
      Given a resource type and name, return {exists: true} if it exists,
      {exists: false} if it does not exist, or {error: {message: error text}
      on error.
  
      .. versionadded:: 2015.8.0
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion boto_vpc.resource_exists internet_gateway myigw
  
      '''
  
      try:
          return {'exists': bool(_find_resources(resource, name=name,
                                                 resource_id=resource_id,
                                                 tags=tags, region=region,
                                                 key=key, keyid=keyid,
                                                 profile=profile))}
      except BotoServerError as e:
          return {'error': __utils__['boto.get_error'](e)f resource_exists(resource, name=None, resource_id=None, tags=None,
                      region=None, key=None, keyid=None, profile=None):
      '''
      Given a resource type and name, return {exists: true} if it exists,
      {exists: false} if it does not exist, or {error: {message: error text}
      on error.
  
      .. versionadded:: 2015.8.0
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion boto_vpc.resource_exists internet_gateway myigw
  
      '''
  
      try:
          return {'exists': bool(_find_resources(resource, name=name,
                                                 resource_id=resource_id,
                                                 tags=tags, region=region,
                                                 key=key, keyid=keyid,
                                                 profile=profile))}
      except BotoServerError as e:
          return {'error': __utils__['boto.get_error'](e)}
docs: Given a resource type and name, return {exists: true} if it exists,
      {exists: false} if it does not exist, or {error: {message: error text}
      on error.
  
      .. versionadded:: 2015.8.0
  
      CLI Example:
  
      .. code-block:: bash
  
          salt myminion boto_vpc.resource_exists internet_gateway myigw