@sns
I understand you are updating terraform in Cloud Shell but facing the above issue.
It appears that you are not completing step 10-12. Can you please move the created terraform file into the bin directory? Then restart Cloud Shell by selecting the power button at the top of the Shell?
mkdir bin
mv terraform bin/
Hope this helps. Let me know if you are still having issues after performing these steps.
-------------------------------
Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.