Now that Chef provisioner has been removed from Terraform, how do you manage nodes/clients from TF? I can bootstrap chef-client with cloud-init and create a node using a validator key, but this is an incomplete solution, because this way I can’t remove the node object of a crashed server, nor recreate it.
You might want to use the Chef Provider. https://www.terraform.io/docs/providers/chef/index.html
Provisioners are generally an old concept now.
From what I see in the docs, it’s not an adequate replacement:
> In most cases it is better to use the
chef provisioner to configure the Chef client on a computer and have it register itself with the Chef server.
Those docs are old. It’s a bit of a chase your tail kind of thing.
We just use ec2 user-data scripts and validator. To remove machines we use a lambda script that is triggered on server termination status to connect and delete node/client objects from chef and other systems like AD, DNS, monitoring, etc….