def _scaling_inner_resource(resource):
    """Return the inner resource wrapped in Heat's scaling resource.

    The property name of the inner resource is inconsistent between
    ResourceGroup and AutoScalingGroup so this does the necessary checks and
    returns the right thing or None on any other type.
    """
    if resource.resource_type == 'OS::Heat::ResourceGroup':
        inner = resource.find_property_by_name('resource_def')
    elif resource.resource_type == 'OS::Heat::AutoScalingGroup':
        inner = resource.find_property_by_name('resource')
    else:
        inner = None
    return inner
