It is the same grammatical function as in this sentence: You are my friend. Traditional grammar books called it a predicate noun. The modern name could be complement.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.