Turn Instant Pot on sauté setting and heat olive oil in the insert.
Add onion, celery and carrots and sauté until starting to soften, a few minutes (keep an eye on it as they can burn if you are not careful...stir occasionally).
Add garlic, stir a few seconds until you can smell the garlic.
Then add herbs and bay leaf, stir and turn off the sauté function.
Add the dried beans to the pot along with the ham shanks.
Pour in the stock and water and combine gently.
Close lid and seal pressure cooker.
Cook on high pressure and set timer for 35 minutes. It will take about 25 minutes to reach pressure and then the timer will start. When finished cooking, let pressure naturally release for 20 minutes.
Manually release any remaining pressure, carefully open pot (only after all pressure is released).
If using a ham bone or shank, then remove ham shanks to cutting board and shred/cut meat into bite-sized pieces. Add back to soup and season with kosher salt and black pepper to taste.
Serve with a salad and some crusty bread for a delicious lunch or supper.