Preheat the oven to 350 degrees F. Spray two 8-inch round cake pans with nonstick cooking spray.
Prepare the cake mix as per box instructions. Divide the prepared cake batter between the two cake pans and bake following box instructions. Let cool before removing the cakes from the pans.
In a medium saucepan, whisk the condensed milk and egg yolks together. Add the butter and cook over medium heat, stirring constantly, until thickened, about 10 minutes. Remove the saucepan from the heat and stir in the coconut, vanilla and pecans. Pour the filling into a bowl to cool.
To assemble the cake: Set one cake layer on a cake stand or serving plate. Spread the top with half of the filling. Add the second cake layer and spread the top with the remaining filling.