Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 10


You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code.

What is the best method to quickly find the IP address of the resource you deployed?

Show Answer
Correct Answer: A,C

Given that no outputs were created in your Terraform code, running 'terraform output ip_address' will not yield any information. The best method to quickly find the IP address of the deployed resource is to run 'terraform state list' to find the name of the resource and then use 'terraform state show' followed by the resource name to display its attributes, which include the public IP address.

Discussion

17 comments
Sign in to comment
coco10kOption: C
Apr 22, 2022

You can find the info in the state. not A because you don't have to outputs defined.

campsOption: C
Mar 31, 2023

C. Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address is the best method to quickly find the IP address of the resource you deployed. terraform state list will show you the name of all the resources currently tracked in your Terraform state. You can then use terraform state show followed by the resource name to see all the details of the resource, including any attributes like the public IP address.

connecttozeeOption: C
Apr 3, 2023

100% is C

cdecheryOption: C
Jul 16, 2023

If there is no output defined for the resource, the "output" command will not show anything. Correct is C.

otakuinsideOption: C
Sep 28, 2023

A cannot be. You don't have any output declared, so there is no default output or something like that where you could find the ip address. On the other hand, terraform state list, and then show specific, contains the state and this includes the ip address

samimshaikhOption: C
Dec 29, 2023

C. Run terraform state list to find the name of the resource, then terraform state show to find the attributes, including the public IP address. Explanation: Not Option A (terraform output ip_address) assumes that there is an output variable named ip_address in your Terraform configuration, but since you mentioned that you did not create any outputs, this option may not be applicable.

Ni33Option: C
May 8, 2023

C is the correct answer

SIAMIANJIOption: C
Jun 2, 2023

C is correct,

Shane_COption: C
Jul 4, 2023

C is the correct the answer. It can't be A as the output isn't defined

Busi57Option: C
Jul 23, 2023

C i choose

JayanthOption: C
Jul 28, 2023

C. Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address

grogudevOption: C
Sep 23, 2023

C I choose too

gofavad926Option: C
Sep 28, 2023

C for sure

luke404Option: C
Nov 2, 2023

The question does not talk about any output defined so you can't expect one

Prat8
Nov 21, 2023

Is it C or A ?

brundabanmOption: C
Jun 11, 2024

C is the correct answer.

hrajkumaOption: C
Jul 12, 2024

vote for option C