'Initialise with the parsed definition of a resource.
Any intrinsic functions present in any of the sections should have been
parsed into Function objects before constructing the definition.
:param name: The name of the resource (for use in error messages)
:param resource_type: The resource type
:param properties: A dictionary of supplied property values
:param metadata: The supplied metadata
:param depends: A list of resource names on which this resource depends
:param deletion_policy: The deletion policy for the resource
:param update_policy: A dictionary of supplied update policies
:param description: A string describing the resource
:param external_id: A uuid of an external resource
:param condition: A condition name associated with the resource'

def __init__(self, name, resource_type, properties=None, metadata=None, depends=None, deletion_policy=None, update_policy=None, description=None, external_id=None, condition=None):

    self.name = name
    self.resource_type = resource_type
    self.description = (description or '')
    self._properties = properties
    self._metadata = metadata
    self._depends = depends
    self._deletion_policy = deletion_policy
    self._update_policy = update_policy
    self._external_id = external_id
    self._condition = condition
    self._hash = hash(self.resource_type)
    self._rendering = None
    self._dep_names = None
    self._all_dep_attrs = None
    assert isinstance(self.description, six.string_types)
    if (properties is not None):
        assert isinstance(properties, (collections.Mapping, function.Function))
        self._hash ^= _hash_data(properties)
    if (metadata is not None):
        assert isinstance(metadata, (collections.Mapping, function.Function))
        self._hash ^= _hash_data(metadata)
    if (depends is not None):
        assert isinstance(depends, (collections.Sequence, function.Function))
        assert (not isinstance(depends, six.string_types))
        self._hash ^= _hash_data(depends)
    if (deletion_policy is not None):
        assert (deletion_policy in self.DELETION_POLICIES)
        self._hash ^= _hash_data(deletion_policy)
    if (update_policy is not None):
        assert isinstance(update_policy, (collections.Mapping, function.Function))
        self._hash ^= _hash_data(update_policy)
    if (external_id is not None):
        assert isinstance(external_id, (six.string_types, function.Function))
        self._hash ^= _hash_data(external_id)
        self._deletion_policy = self.RETAIN
    if (condition is not None):
        assert isinstance(condition, (six.string_types, bool, function.Function))
        self._hash ^= _hash_data(condition)
    self.set_translation_rules()
