Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

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.

Exam Terraform Associate topic 1 question 20 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 20
Topic #: 1
[All Terraform Associate Questions]

You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with
Terraform and want to manage these VMs using Terraform instead.
What are the two things you must do to achieve this? (Choose two.)

  • A. Provision new VMs using Terraform with the same VM names
  • B. Use the terraform import command for the existing VMs
  • C. Write Terraform configuration for the existing VMs
  • D. Run the terraform import-gcp command
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️
The terraform import command is used to import existing infrastructure.
Import existing Google Cloud resources into Terraform with Terraformer.
Reference:
https://www.terraform.io/docs/cli/import/usage.html
https://cloud.google.com/docs/terraform

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
tipzzz
Highly Voted 2 years, 2 months ago
BC for sure
upvoted 31 times
...
fabiomlop
Highly Voted 2 years ago
Selected Answer: BC
You should create the equivalent configuration first, and then run import to load it on the state file.
upvoted 17 times
...
doodlearmy
Most Recent 3 days, 2 hours ago
Selected Answer: BC
there is no 'import-gcp' in terraform official doc
upvoted 1 times
...
kingfighers
3 months, 1 week ago
there is no 'import-gcp' in terraform official doc
upvoted 2 times
...
enook
6 months, 1 week ago
Selected Answer: BC
BCBCBCBCBCBC
upvoted 2 times
...
Tyler2023
8 months, 2 weeks ago
There are two ways to manage existing resource using Terraform You can use 'terraform import' or you can use the import block So answers are: B. Use the terraform import command for the existing VMs Most Voted C. Write Terraform configuration for the existing VMs https://developer.hashicorp.com/terraform/cli/import/usage https://developer.hashicorp.com/terraform/language/import
upvoted 2 times
...
Jayanth
11 months, 2 weeks ago
B. Use the terraform import command for the existing VMs C. Write Terraform configuration for the existing VMs
upvoted 2 times
...
Busi57
11 months, 2 weeks ago
Selected Answer: BC
i choose BC
upvoted 1 times
...
Busi57
11 months, 2 weeks ago
i choose BC
upvoted 2 times
...
Shane_C
1 year ago
Selected Answer: BC
BC are the correct answers here
upvoted 1 times
...
milan92stankovic
1 year ago
Selected Answer: BC
Write configuration and import.
upvoted 1 times
...
Ni33
1 year, 2 months ago
Selected Answer: BC
B&C are correct
upvoted 2 times
...
karendavtyan
1 year, 2 months ago
Selected Answer: BC
B.True C. True
upvoted 1 times
...
AzRNoob
1 year, 3 months ago
BC are the correct options: B. Use the terraform import command for the existing VMs. This command allows you to import existing infrastructure into your Terraform state file so that Terraform can manage it. You will need to provide the resource type and name, along with any required attributes, for each VM you want to import. C. Write Terraform configuration for the existing VMs. Once the VMs have been imported into the Terraform state file, you will need to write configuration code that describes the desired state of the VMs. This will typically involve creating a new Terraform module or modifying an existing one to include the imported resources. Option A is incorrect because provisioning new VMs with the same names would create duplicate resources and could cause conflicts with the existing VMs. Option D is also incorrect because there is no terraform import-gcp command in Terraform. The correct command for importing GCP resources is simply terraform import.
upvoted 9 times
...
connecttozee
1 year, 3 months ago
BC is correct https://developer.hashicorp.com/terraform/tutorials/state/state-import
upvoted 1 times
...
Power123
1 year, 3 months ago
B,C - first write the configuration and then import
upvoted 1 times
...
acheiron
1 year, 3 months ago
Selected Answer: BC
Write configuration then import the existing infrastructure.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...
ex Want to SAVE BIG on Certification Exam Prep?
close
ex Unlock All Exams with ExamTopics Pro 75% Off
  • arrow Choose From 1000+ Exams
  • arrow Access to 10 Exams per Month
  • arrow PDF Format Available
  • arrow Inline Discussions
  • arrow No Captcha/Robot Checks
Limited Time Offer
Ends in