Over the years having produced many raised bed planters using treated wood, only to revisit and reconstruct the planters every 10-12 years, I've since taken a different approach.
For small individual planters, I'll take clay chimney flue liners and cut them with a diamond blade to whatever length I want. The lifetime is 20+ years, I'm still using some that are over 30 years old.

For larger planters I've installed COR-TEN items. I gave them many water rinses so that the protective oxide layer would grow on the outer surfaces. Then I placed each one and filled them with good topsoil. The lifetime should also be 20+ years but we'll see. Certainly that's double the service life of treated 2x materials.

For relatively short height walls, I've used 4 x 4 black plastic landscape timbers sold by Menards. Made in the USA from 97% recycled post-consumer plastic and containing no wood products.
"BestPLUS warrants to the original purchaser that, for a period of fifteen (15) years from the date of the original purchase at retail the Product will not crack, rot, corrode, or suffer structural damage from insect infestation."It's easily worked with traditional woodworking tools and I've staked it in-place with 1" galvanized pipe driven 40" into the ground. With some attention to hole placement and careful measurement, everything fits together well, probably because there's no warping or twisting to factor in.
They also make traditional sized 2x boards.
https://www.bestpl.us/products

