Description
A variable’s description tells callers what to supply and when to override the default.
Potential impact
If the purpose is unclear, callers may choose the wrong value or need help from the module author.
Remediation
Describe the purpose and expected value in each variable block. Add validation when the module must enforce a restriction.
Examples
The description identifies cluster_name as the name of the Kubernetes cluster to create. Its default is still "example".
Before
hcl
variable "cluster_name" {
type = string
default = "example"
}
After
hcl
variable "cluster_name" {
type = string
default = "example"
description = "Name of the Kubernetes cluster to create"
}