I am creating VM using terraform. Now I want to run some command using remote-exec on that VM before it destroyed.
Is there any way to this?
Thanks
I am creating VM using terraform. Now I want to run some command using remote-exec on that VM before it destroyed.
Is there any way to this?
Thanks
Take a look at the Destroy-Time Provisioners section of the Provisioners documentation. It should accomplish what you’re asking.