Spike protein production by mRNA vaccines?
I am asking this question to understand whether the cells which are
used to create spike proteins are attacked by the immune system.

Yes, that is the aim of RNA vaccinations!
But don't worry, that's a good thing, as can be concluded from this review-paper, that emphasizes the advantage of RNA vaccinations to invoke cellular immune response:

Although subunit vaccines have been used successfully to elicit
humoral immunity against a wide variety of pathogens, they fail to
induce cellular immunity which is required to eradicate the
intracellular pathogen reservoir of many chronic diseases, including
viral infections such as HIV or hepatitis C.

Basically, the idea is that presented antigens from traditional vaccines are inclined to be presented via MHC2, rather causing humoral immunity, while after RNA transfection, cellularly produced peptides can also be presented on MHC1, causing cellular immunity.