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
5 months, 2 weeks ago

The answer should be B.

Aamir_Ahmed
5 months, 2 weeks ago

The answer should be B.

Greatman
2 months, 3 weeks ago

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

Answer: C

Greatman
2 months, 3 weeks ago

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

satrier
2 months, 1 week 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>