Amalek was a type of the flesh. He was descended from Esau; and Esau represented the carnal nature.
Exodus 17:10-11 So Joshua fought the Amalekites as Moses had ordered, and Moses, Aaron and Hur went to the top of the hill. As long as Moses held up his hands, the Israelites were winning, but whenever he lowered his hands, the Amalekites were winning. This is no ordinary fight, it is not won through having great skill or great forces. While Joshua and his men had to fight in the battle, the outcome didn’t rest on their strength or weakness. Victory rested in Moses lifting his hands! Victory was gained as Moses lifted his hands to Heaven, a symbolic act of prayer and surrender.