Efficient control of a magnetization without an application of the external magnetic fields is the ultimate goal of spintronics. We demonstrate, that in monolayers of $text{CrI}_3$, magnetization can be switched all optically, by application of the resonant pulses of circularly polarized light. This happens because of the efficient coupling of the lattice magnetization with bright excitonic transition. $text{CrI}_3$ is thus perspective functional material with high potential for applications in the domains of spintronics and ultra-fast magnetic memory.