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.
In more detail
Changing any value in its triggers map replaces it, which makes it handy for demonstrating plans, state and dependencies without a cloud. The course uses it to model a network and its subnets locally. Since Terraform 1.4 the built-in terraform_data resource does the same job without an extra provider.
Example
resource "null_resource" "network" {
triggers = { name = var.name }
}Related terms
- 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.
- resource replacement — When Terraform must destroy a resource and create a new one because a changed setting cannot be updated in place.
- local provider — HashiCorp's provider for managing files on the machine where Terraform runs, used throughout the course because it needs no cloud account.
Taught in
- Writing A Custom Network Module — Infrastructure as Code with Terraform
- Scaling Resources With Count — Infrastructure as Code with Terraform
- Iterating Over Maps With For Each — Infrastructure as Code with Terraform
- Explicit Dependencies With Depends On — Infrastructure as Code with Terraform
- Safe Changes With Lifecycle Rules — Infrastructure as Code with Terraform
- Provisioners: Why They Are A Last Resort — Infrastructure as Code with Terraform
- What State Really Is And Why It Is Needed — Infrastructure as Code with Terraform
- Simulating A Managed Database — Infrastructure as Code with Terraform
- Detecting And Fixing Configuration Drift — Infrastructure as Code with Terraform
- Importing Existing Resources — Infrastructure as Code with Terraform
- Forcing Replacement — Infrastructure as Code with Terraform
- Collaboration And Governance: Teams, Policies, Registry And Health — HashiCorp Terraform Associate (004) Exam Prep
- VCS, CLI And API Workflows: Speculative Plans And Run Triggers — HashiCorp Terraform Associate (004) Exam Prep
- Trap Sprint: Twelve Answers That Are Almost True — HashiCorp Terraform Associate (004) Exam Prep
- The Full Mock: Sixty Minutes, Eight Areas, One Plan For The Last Week — HashiCorp Terraform Associate (004) Exam Prep