Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 159


How would you reference the attribute "name" of this fictitious resource in HCL?

Show Answer
Correct Answer: C

To reference the attribute 'name' of the resource 'kubernetes_namespace' named 'example' in HCL (HashiCorp Configuration Language), the correct syntax is 'kubernetes_namespace.example.name'. This follows the standard format: resource_type.resource_name.attribute_name.

Discussion

5 comments
Sign in to comment
HizumiOption: C
Sep 5, 2022

Correct answer is C. References to Resource Attributes Doc: https://www.terraform.io/language/expressions/references#references-to-resource-attributes

depal_dhirOption: C
Sep 7, 2022

https://www.terraform.io/language/expressions/references#references-to-resource-attributes

InformationOverloadOption: C
Dec 29, 2022

C looks fine to me!

tychoOption: C
Apr 18, 2023

Answer C; that would be the equivalent to kubectl create ns :)

090200fOption: C
Jul 21, 2024

C is correct answer no need to spllly mention resource here