Interview Prep/Terraform/Providers, Resources and Data Sources

What are `terraform_data` and `null_resource`?

IntermediateConceptProviders, Resources and Data Sources
Answer

Both are resources that do nothing themselves but hold values or attach provisioners and triggers. terraform_data (built in, Terraform 1.4+) replaces null_resource from the null provider; it has input and triggers_replace to force recreation when a value changes.

resource "terraform_data" "bootstrap" {
  triggers_replace = [aws_instance.web.id]
  provisioner "local-exec" { command = "./register.sh" }
}
All Terraform questions Roadmap: Terraform

More on Providers, Resources and Data Sources