Supergravity solutions with constant scalar invariants