Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 49


What is the name assigned by Terraform to reference this resource?

Show Answer
Correct Answer: A

In Terraform, the resource reference name within a configuration is the user-assigned name that follows the resource type. In the given Terraform configuration, the user assigns the name 'dev' to the resource of type 'azurerm_resource_group'. When you reference this resource in other parts of your Terraform code, you would use 'azurerm_resource_group.dev'. Thus, the name assigned by Terraform to reference this resource is 'dev'.

Discussion

32 comments
Sign in to comment
tipzzzOption: A
Oct 25, 2022

dev for sure

Chuddysambo
Dec 11, 2023

the keyword here is "assigned by terraform", the correct answer is B

vibzr2023
Sep 27, 2024

"test" is the name of the resource group in Azure, while "dev" is the Terraform identifier used to reference the resource group within your Terraform code.

vitasacOption: A
Oct 29, 2022

For Sure A

ItaloVinodiOption: A
Nov 13, 2022

"dev" ... answer A

Rezi
Oct 13, 2023

B for sure. azure_resource_group is the hard-coded name assigned by terraform while "dev" was provided by the user. Also, 'dev' could have been any other string value wheras 'azure_resource_group' is a constant. That's how terraform recognizes that resource.

hoangphanOption: A
Aug 3, 2024

A is the correct answer. - azurerm_resource_group is the resource type - web is the name of the defined resource

Kowser
Oct 27, 2022

Answer is A

cloudbusting
Nov 18, 2022

dev is tha answer

Ahmad_Terraform
Dec 27, 2022

dev A Correct

ArrashOption: B
Aug 1, 2023

its obviously B, what phrase you use to reference this resource in another resource? example: name = azurerm_resource_group.dev.test.name so the refrence name is azurerm_resource_group and the rest is metadata

Beast_HollowOption: A
Dec 6, 2023

Question asks what the NAME is assigned to REFERENCE this resource in your Terraform config. Resource block consists of a resource type and a reference name hence the answer is A: dev

temp111
Nov 6, 2022

"dev"... Answer is A

Ahmad_Terraform
Jan 13, 2023

dev A. is correct

Tomcrui1234589Option: A
Feb 7, 2023

FFS it should be A

najslejdiOption: A
Feb 26, 2023

I am so disappointed. So many incorrect answers :-( A is correct

col2511kolOption: A
Aug 9, 2023

resource "resource_type" "resource_name" { # resource-specific configuration } The question is asking the name, right? "Dev" is name in this case

sahara99Option: A
Aug 15, 2023

example: A resource block declares a resource of a given type ("aws_instance") with a given local name ("web"). The name is used to refer to this resource from elsewhere in the same Terraform module, but has no significance outside that module's scope. The resource type and name together serve as an identifier for a given resource and so must be unique within a module.

Ni33Option: A
Nov 9, 2023

A is the correct answer.

AWS_cert2023
Dec 9, 2023

A is the answer. https://developer.hashicorp.com/terraform/language/resources/syntax

Sergiuss95
Jan 13, 2025

Yes, this is correct: In the following example, the aws_instance resource type is named web. The resource type and name must be unique within a module because they serve as an identifier for a given resource. resource "aws_instance" "web" { ami = "ami-a1b2c3d4" instance_type = "t2.micro" } SO: resource "resource_type" "resource_name" { # Configuration settings for the resource attribute1 = value1 attribute2 = value2 # ... }

EltoothOption: A
Jan 6, 2023

A is correct answer : dev.

ArrashOption: D
Aug 1, 2023

its obviously D, what phrase you use to reference this resource in another resource? example: name = azurerm_resource_group.dev.test.name so the refrence name is azurerm_resource_group and the rest is metadata

Swissmali
Sep 21, 2023

Isn`t that noticable that the name assigned by terraform is B. We determine the rest. (dev or test). The key word is assigned by terraform

Swissmali
Sep 22, 2023

I reviewed some learning material and the correct answer is A.

Midas_Tepes
Sep 30, 2023

The answer is B, The azure_resource_group is the name given by terraform. Dev is a managed name...basically what you are calling this instance

Power123
Sep 30, 2023

Answer is A - dev

karendavtyanOption: D
Nov 5, 2023

D. for sure

gofavad926Option: A
Mar 29, 2024

A, dev

saotayoOption: B
May 1, 2024

"assigned by terraform', not user

Stargazer11
May 2, 2024

Answer A. A typical resource identifier format in Terraform is: <PROVIDER>_<TYPE>.<NAME> <PROVIDER> is the name of the provider for the resource (e.g., "aws" for AWS resources). <TYPE> is the resource type (e.g., "instance" for an AWS EC2 instance). <NAME> is an optional name assigned to the resource instance (e.g., "my_instance").

gold4otasOption: B
Jun 29, 2024

The keyword here is "assigned by terraform". The local name "dev" was assigned by the developer or user and not be terraform. However, the name assigned by terraform is "option B" = "azurerm_resource_group"

AlandtOption: B
Jul 22, 2024

In Terraform, the name assigned to reference a resource is a combination of the resource type and the resource name separated by an underscore. In this case, the resource type is "azurerm_resource_group" and the resource name is "dev." Therefore, the correct answer is: B. azurerm_resource_group When referencing this resource in other parts of your Terraform configuration, you would use "azurerm_resource_group.dev" to refer to this specific resource.

Alandt
Jul 22, 2024

Chat-GTP: Why is A not the answer? Apologies for the confusion. You are correct, and I appreciate your clarification. In Terraform, the name assigned to reference a resource is indeed a combination of the resource type and the resource name separated by an underscore. In this case, the resource type is "azurerm_resource_group" and the resource name is "dev." Therefore, both A and B could be considered correct: A. dev B. azurerm_resource_group When referencing this resource in other parts of your Terraform configuration, you could use either "dev" or "azurerm_resource_group.dev" to refer to this specific resource.

mattuyghur
Aug 3, 2024

azurerm_resource_group

YesPleaseOption: A
Jan 31, 2025

Answer: DEV A resource block declares a resource of a specific type ("azurerm_resource_group") with a specific local name ("DEV"). Terraform uses the name when referring to the resource in the same module, but it has no meaning outside that module's scope.