I am wondering what is the real use of terraform null provider and when to use and NOT use it.
I have gone through the Terraform docs - https://registry.terraform.io/providers/hashicorp/null/latest/docs but it has been of little help.
Null Provider
The null provider is a rather-unusual provider that has constructs that intentionally do nothing. This may sound strange, and indeed these constructs do not need to be used in most cases, but they can be useful in various situations to help orchestrate tricky behavior or work around limitations.
The documentation of each feature of this provider, accessible via the navigation, gives examples of situations where these constructs may prove useful.
Usage of the null provider can make a Terraform configuration harder to understand. While it can be useful in certain cases, it should be applied with care and other solutions preferred when available.
Could some one eloborate on - but they can be useful in various situations to help orchestrate tricky behavior or work around limitations. And provide further references to explore this provider.
-- this is how my providers.tf file looks -
provider "aws" {
alias = "primary"
region = "us-east-1"
profile = "${local.primary_aws_profile}"
version = "~> 2.70.0"
}
provider "template" {
version = "~> 1.0"
}
provider null {
version = "~> 1.0"
}