But yes, that is how vaccines work more or less. Though I believe the virus in the vaccine is either dead or incapacitated in some way.
https://en.m.wikipedia.org/wiki/Variolation
The first real vaccine was to inoculate with cowpox instead, which was safe for humans but induced immunity to smallpox as well.
Modern methods are substantially safer, usually by entirely deactivating the virus before using it, but there are still some vaccines that use live virus (the oral polio vaccine is a live attenuated virus).
Vaccines are not all attenuated. Often they are killed. See https://en.wikipedia.org/wiki/Inactivated_vaccine for more on that.
This is a (bad) philisophical question for people who do not understand the concept of "spectrum", not a scientific question.
Deciding where on the spectrum between non-life and life we declare something to be alive is endlessly debatable and non-actionable. The fact that in time technology will add more points on that spectrum does not change this fact.