code: def from_dict(cls, logical_id, resource_dict, relative_id=None, sam_plugins=None):
          
  
          resource = cls(logical_id, relative_id=relative_id)
  
          resource._validate_resource_dict(logical_id, resource_dict)
  
          # Default to empty properties dictionary. If customers skip the Properties section, an empty dictionary
          # accurately captures the intent.
          properties = resource_dict.get("Properties", {})
  
          if sam_plugins:
              sam_plugins.act(LifeCycleEvents.before_transform_resource, logical_id, cls.resource_type, properties)
  
          for name, value in properties.items():
              setattr(resource, name, value)
  
          if 'DependsOn' in resource_dict:
              resource.depends_on = resource_dict['DependsOn']
  
          # Parse only well known properties. This is consistent with earlier behavior where we used to ignore resource
          # all resource attributes ie. all attributes were unsupported before
          for attr in resource._supported_resource_attributes:
              if attr in resource_dict:
                  resource.set_resource_attribute(attr, resource_dict[attr])
  
          resource.validate_properties()
          return resource
docs: Constructs a Resource object with the given logical id, based on the given resource dict. The resource dict
          is the value associated with the logical id in a CloudFormation template's Resources section, and takes the
          following format. ::
  
              {
                  "Type": "<resource type>",
                  "Properties": {
                      <set of properties>
                  }
              }
  
          :param str logical_id: The logical id of this Resource
          :param dict resource_dict: The value associated with this logical id in the CloudFormation template, a mapping \
          containing the resource's Type and Properties.
          :param str relative_id: The logical id of this resource relative to the logical_id. This is useful
                                  to identify sub-resources.
          :param samtranslator.plugins.SamPlugins sam_plugins: Optional plugins object to help enhance functionality of
              translator
          :returns: a Resource object populated from the provided parameters
          :rtype: Resource
          :raises TypeError: if the provided parameters are invalid