"And it shall be, when the LORD your God has given you rest from all your enemies" and so on (Deuteronomy 25:19). Rabbi Azariah and Rabbi Judah son of Rabbi Simon, in the name of Rabbi Judah son of Ilai: Concerning three things Israel were commanded when they entered the land: to appoint a king over themselves, to build for themselves the Chosen House, as it says, "And let them make Me a sanctuary" and so on (Exodus 25:8), and to blot out the memory of Amalek.
Three Commands Israel Received Upon Entering the Land
Pesikta DeRav Kahana 3:14
[יד] והיה בהניח י"י אלהיך מכל אויביך וג' (דברים כה:יט). ר' עזריה ר' יודה בר' סימון בשם ר' יוד' בר' אלעיי, על שלשה דברים נצטוו ישר' בכניסתן לארץ, למנות עליהם מלך, ולבנות להם בית הבחירה ועשו לי מקדש וג' (שמות כה:ח), ולמחות את זכר עמלק.