A vaccine is "A product that stimulates a person's immune system system to produce immunity to a specific disease, protecting that person from the disease..."
Immunity is "Protection from an infectious disease. If you are immune to a disease, you can be exposed to it without becoming infected."
Both of these definitions are from the CDC Immunizations: The Basics Page.