One easy way to install Terraform is using tfenv, a version manager for Terraform.
git clone https://github.com/tfutils/tfenv.git ~/.tfenv
We can take advantage of the fact that /home/cloudshell-user/bin
is already in the PATH by default in CloudShell:
mkdir ~/bin
ln -s ~/.tfenv/bin/* ~/bin/
tfenv install 1.5.7
tfenv use 1.5.7
That should set you up with a working terraform. Test it with:
terraform --version