@classmethod<EOL><INDENT>def from_dict(cls, logical_id, resource_dict, relative_id=None, sam_plugins=None):<DEDENT>
resource = cls(logical_id, relative_id=relative_id)<EOL>resource._validate_resource_dict(logical_id, resource_dict)<EOL>properties = resource_dict.get("<STR_LIT>", {})<EOL>if sam_plugins:<EOL><INDENT>sam_plugins.act(LifeCycleEvents.before_transform_resource, logical_id, cls.resource_type, properties)<EOL><DEDENT>for name, value in properties.items():<EOL><INDENT>setattr(resource, name, value)<EOL><DEDENT>if '<STR_LIT>' in resource_dict:<EOL><INDENT>resource.depends_on = resource_dict['<STR_LIT>']<EOL><DEDENT>for attr in resource._supported_resource_attributes:<EOL><INDENT>if attr in resource_dict:<EOL><INDENT>resource.set_resource_attribute(attr, resource_dict[attr])<EOL><DEDENT><DEDENT>resource.validate_properties()<EOL>return resource<EOL>
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