You could make a structure but it would be much easier to make it spawn like an ore. Basically all you need to do is make the block and then go to the "Generation" tab, set the amount of blocks you want to spawn in the group, and set the block to spawn near or on the ceiling of what you're trying to do using Minimal Y and Maximal Y (set minimal to the same as maximal in this case if you want it to spawn on the ceiling) Make sure you select a dimension for the block to spawn in otherwise it won't spawn.
You could make a structure but it would be much easier to make it spawn like an ore. Basically all you need to do is make the block and then go to the "Generation" tab, set the amount of blocks you want to spawn in the group, and set the block to spawn near or on the ceiling of what you're trying to do using Minimal Y and Maximal Y (set minimal to the same as maximal in this case if you want it to spawn on the ceiling) Make sure you select a dimension for the block to spawn in otherwise it won't spawn.