terraform-associate question 358 discussion

View all HashiCorp Certified: Terraform Associate Exam here
back to hashicorp forum

Question 358

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

A. resource.kubrnetes_namespace>example.name
B. kubernetes_namespace.test.name
C. kubernetes_namespace.example,name
D. data kubernetes_namespace.name
E. None of the above

Answer:

C


Discussions
0 / 1000
Aamir_Ahmed
3 months, 3 weeks ago

The answer should be B.

Aamir_Ahmed
3 months, 3 weeks ago

The answer should be B.

Greatman
1 month, 1 week ago

In HCL (HashiCorp Configuration Language), you reference a resource attribute using the pattern:
<resource_type>.<resource_name>.<attribute>

Answer: C

Greatman
1 month, 1 week ago

resource "kubernetes_namespace" "example" {
metadata {
name = "my-namespace"
}
}

satrier
3 weeks, 4 days ago

B
In HCL (HashiCorp Configuration Language), which is used by Terraform, you reference an attribute of a resource using this syntax:

<resource_type>.<resource_name>.<attribute>