Minecraft wiki entry for Beacon, associated text: Beacons require an unobstructed view of the sky.
Transparent blocks (glass, water, etc.) and bedrock (the nether ceiling) are allowed.
The beacon is on top of a pyramid constructed from iron blocks, gold blocks, emerald blocks, diamond blocks, and/or netherite blocks.