I would approach this two different ways.
If you plan to leave the truck stock then you could maybe find a cheap junk yard motor, but you are taking a chance on it.
You could also find a reputable builder and buy a built engine that will meet your needs today and future upgrade needs. There are "budget" builds you can do that will help increase the reliability of the engine. Keep in mind "budget" on a Duramax isn't cheap.
I know that ATPTrucks.com works with a builder in Idaho that does a very good job, also SoCal has a very good engine. SoCal does charge a premium for their engines though and may not be a "budget" option.
If you do build a motor, don't go 100% stock as it won't make sense for you.
At least go LBZ rods, LB7 pistons, keyed crank/cam, balanced (IMO this is crucial, internally balanced is well worth the extra IMO too.), etc...
My main point here is for a small percentage more then a used engine that has an unknown past, you might be able to get a mildly built motor that you know the history on. Sent from my iPhone using AutoGuide.com App