If you haven't already, make sure .tf
files are set to the terraform
filetype
au BufRead,BufNewFile *.tf setlocal filetype=terraform
Then, add via your favorite plugin manager. For instance, if you use vim-plug:
Plug 'zhimsel/terraform-vim-folding', { 'for': 'terraform' }