What is the Suns role in an ecosystem?

The key role of the sun is to provide the light needed for photosynthesis. It also provides the heat that organisms need to survive.