Which of the following is allowed as a valid Terraform variable name?

Prepare for your Terraform Associate Exam with our engaging quiz. Test your knowledge with multiple choice questions and receive detailed explanations to enhance your understanding. Ace your exam with confidence!

In Terraform, variable names must adhere to specific naming conventions. The correct choice, which is "name," follows these conventions perfectly. Variable names can consist of letters, digits, underscores, and can be any length, but they cannot begin with a digit, include special characters like dashes or periods, or start with a number.

The variable name "name" is simple and only contains alphabetic characters, making it a valid identifier in Terraform. It clearly adheres to the rules of not starting with a number or including restricted symbols.

On the other hand, "user-name" includes a hyphen, which is not allowed in Terraform variable names. The name "user.name" contains a period, which is also prohibited. Lastly, "1stName" begins with a digit, which likewise violates the naming conventions. Thus, "name" stands out as the only valid option among the choices provided.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy