How do I extrude a shape with a cross section?

Let’s say I have drawn the following 2D Trapezoidal shape. I can turn this into 3D by extruding it as shown in the picture.
trap

In this case, it has a rectangular cross section. Now let’s say I also drew this hexagonal shape;
hex

I want to use this hexagon as the cross section of my trapezoid.
The only way I could think of was to extrude the hexagon with varying length all the way up to the top of the trapezoid. Think of stacking a lot of extremely thin hexagons on top of each other. Or better yet, drawing a long hexagon on top and a small hexagon on the bottom and connecting them.

How can I achieve this? I hope my question was clear. Thanks.