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
C
The answer should be B.
The answer should be B.
In HCL (HashiCorp Configuration Language), you reference a resource attribute using the pattern:
<resource_type>.<resource_name>.<attribute>
Answer: C
resource "kubernetes_namespace" "example" {
metadata {
name = "my-namespace"
}
}
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>