Which of the following correctly describes how to define an input variable in a Terraform module?
Terraform uses a specific block keyword to declare variables.
Terraform input variables are declared using the variable block with a name and optional attributes like type and default.
Which option correctly defines an output named instance_ip in a Terraform module?
Outputs use a block with a name and a value attribute.
Terraform outputs are declared with an output block naming the output and specifying the value to expose.
Which directory structure follows Terraform best practices for a reusable module named network?
Look for standard file names used in Terraform modules.
Terraform modules typically use main.tf for resources, variables.tf for inputs, outputs.tf for outputs, and README.md for documentation.
Which option correctly marks a variable as sensitive in a Terraform module to avoid showing its value in logs?
Terraform uses a specific attribute to mark variables as sensitive.
The sensitive = true attribute in a variable block tells Terraform to hide the value in output and logs.
You update the source attribute of a Terraform module to point to a new version. What happens to the existing resources managed by the old module version when you run terraform apply?
Think about how Terraform tracks resources and modules in state files.
Changing the module source is treated as a new module instance. Terraform plans to create new resources from the new source and keeps old resources unless you remove or replace them explicitly.