Terraform Associate Practice Exam

Question: 1 / 400

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

user-name

name

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.

Get further explanation with Examzify DeepDiveBeta

user.name

1stName

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy