The Spray Foam I am familiar with sells at Lowe's, Home Depot and other Home Improvement or Hardware stores for about $8 a can. It is basically used for filling cracks in Foundations and where Pipes and Wires go through a wall to keep bugs and moisture out. It comes out of the spray can as a thick liquid and blows itself up with air bubbles to fill voids. I started making Diversion Safes and I use Spray Foam for those.
From what I saw, it comes in two formulas. One is water soluble and cleans up easier than the one that is not water soluble.
I would guess that the one that does not clean up with water is better for a place that may get wet, like a barrel channel.
Spray Foam degrades over time if in a place where weather can hit it and will have to be done again some time in future years.
As another tip for the 'do-it-yourselfers', I am becomming a big fan of those 2 part Epoxy sticks that come in Putty form. I have used that stuff on many things where a void must be filled permanently. I once used it to patch a plastic Gas Tank on a Lawn Boy 2 cycle mower and so far the Gasoline has not affected the patch job. I have found it at Walmarts/Sporting Goods/Marine. It is made for boats and can take adverse conditions.
Black on the outside, white on the inside. Knead as much as you think you require for the job and until it is all Grey, then squish it into place. After it cures, it is hard as a rock.
It kind of takes me back to my Play-Doh years.