terraform_data
A built-in resource, available since Terraform 1.4, that stores a value in state and can trigger replacement, without needing any provider.
In more detail
It is the modern replacement for null_resource. Its triggers_replace argument forces replacement when a value changes.
Example
resource "terraform_data" "example" {
input = var.name
}Related terms
- null_resource — A resource from the hashicorp/null provider that creates nothing real, used as a placeholder or to run actions when its triggers change.
- resource replacement — When Terraform must destroy a resource and create a new one because a changed setting cannot be updated in place.
Taught in
- Writing A Custom Network Module — Infrastructure as Code with Terraform
- Safe Changes With Lifecycle Rules — Infrastructure as Code with Terraform
- Reading A Plan, Saving It, Applying It — HashiCorp Terraform Associate (004) Exam Prep
- Dependencies, depends_on And Lifecycle Rules — HashiCorp Terraform Associate (004) Exam Prep
- Sensitive Data, Ephemeral Values And Secrets From Vault — HashiCorp Terraform Associate (004) Exam Prep
- State Locking: One Writer At A Time — HashiCorp Terraform Associate (004) Exam Prep
- Runs In HCP Terraform: The cloud Block And Remote Execution — HashiCorp Terraform Associate (004) Exam Prep