def set(self, logicalId, resource):
resource_dict = resource<EOL>if isinstance(resource, SamResource):<EOL><INDENT>resource_dict = resource.to_dict()<EOL><DEDENT>self.resources[logicalId] = resource_dict<EOL>
Adds the resource to dictionary with given logical Id. It will overwrite, if the logicalId is already used.

:param string logicalId: Logical Id to set to
:param SamResource or dict resource: The actual resource data