According to Genesis 9, God set a rainbow in the clouds as the sign of the covenant with Noah.
After the Flood, Genesis describes a covenant involving God, Noah, his descendants, and every living creature. The rainbow is presented as the visible reminder of that promise. Whenever clouds cover the earth and the rainbow appears, the text says the covenant will be remembered.
The covenant is broader than a private promise to Noah. Genesis explicitly includes future generations and living creatures, making the rainbow a sign associated with the whole post-Flood world in the narrative.
The biblical account does not describe the rainbow as being created for the first time at that moment. Instead, it identifies the rainbow as the covenant sign. In later cultures and religions, rainbows have acquired additional symbolic meanings, but Genesis specifically connects this one with the covenant following the Flood.