Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.
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?
A.
Run terraform output ip_address to view the result
B.
In a new folder, use the terraform_remote_state data source to load in the state file, then write an output for each resource that you find the state file
C.
Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address
D.
Run terraform destroy then terraform apply and look for the IP address in stdout
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.
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
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.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
coco10k
Highly Voted 2 years agosamimshaikh
Most Recent 3 months, 4 weeks agoPrat8
5 months agoluke404
5 months, 3 weeks agogofavad926
6 months, 4 weeks agootakuinside
7 months agogrogudev
7 months agoJayanth
9 months agoBusi57
9 months agocdechery
9 months, 1 week agoShane_C
9 months, 3 weeks agoSIAMIANJI
10 months, 4 weeks agoNi33
11 months, 3 weeks agoconnecttozee
1 year agocamps
1 year agoPower123
1 year agoalexsandroe
1 year, 1 month ago