Question Doubt related to Certifications questions

Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers?
A. servers = num_servers
B. servers = variable.num_servers
C. servers = var(num_servers)
D. servers = var.num_servers

I am confused between B and D. Could you please help me here?

The var. prefix is used to reference variables defined in the Terraform configuration. Option B, servers = variable.num_servers , is not correct because variable is not used to reference the value of a variable, but rather to define a variable block.

So the correct answer is D?

Yes, the correct answer is D.