Be careful of concrete in a recirculating aquarium. Until the cavity has been soaked for weeks, it can be toxic depending on the cement used.
A technique that we commonly use to monitor stomatopod populations on shallow reefs and grass beds is to make hundreds of artificial cavities (AC's) and place them in grid pattern. We then check the cavities every few days to see who is moving around in the population. In one study in Panama we put out 300 cavities and checked them every other day for six months. We collected over 6,000 Neogonodactylus.
I wondered if our AC's were attractive to the stomatopods, so we offered animals a choice in the lab between natural cavities that had contained a stomatopod of similar size or an appropriate AC. Animals that had been living in rubble preferred rubble, those living in AC's preferred AC.s.
We made our AC's using Speedcrete. I used a one pint deli plastic container. We filled the cup about half full with concrete and as it started to set, pushed half wayinto the surface a length of wooden dowel of the appropriate length and diameter. To attract a 5 cm Neogonodactylus, we used a dowel about 2 cm in diameter and 8 cm long. Because stomatopods prefer a small entrace roughly their diameter, we added a short, 1 cm piece of 1.2 cm dowel to one end of the larger dowel and this "neck" was in contact with the side of the container. The dowel was soaked in vegetable oil prior to use so that it would not stick to the concrete. We also made a couple of shallow depressions in the surface of the concrete before it set. After a day when the concrete was hard, we coated the surface with oil and poured in another two inches of concrete. The next day when it was hard, we removed the concrete from the container, gently tapped it to separate the two halves, and removed the dowel. We then rearticulated the two halves, cleaned out the entrance to the cavity using a circular file, cut a grove in the edges so that the two halves could be secured with plastic twist tie, and soaked them for a few weeks in the ocean. They were then deployed on the grass beds where they could be easily opened, retied, and put back. We still find AC's that were put out 15 years ago and they still have stomatopods living in them.
For use in aquaria where you don't want to worry about toxicity, ceramic materials can be cast and fired. If you don't want to make it in two pieces, you can model the clay into a form with an appropriate cavity and leave the back open with a round hole. You can then use a rubber stopper to seal the cavity, but can remove it if you want to take the animal out (important to me for experiments, but perhaps not for you)..
Roy