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

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 74 discussion

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

How is terraform import run?

  • A. As a part of terraform init
  • B. As a part of terraform plan
  • C. As a part of terraform refresh
  • D. By an explicit call
  • E. All of the above
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Eltooth
Highly Voted 2 years, 4 months ago
Selected Answer: D
I'm going with D based on this doc. "The current implementation of Terraform import can only import resources into the state. It does not generate configuration. A future version of Terraform will also generate configuration. Because of this, prior to running terraform import it is necessary to write manually a resource configuration block for the resource, to which the imported object will be mapped. While this may seem tedious, it still gives Terraform users an avenue for importing existing resources." https://www.terraform.io/cli/import/usage
upvoted 9 times
Eltooth
2 years, 4 months ago
https://www.terraform.io/cli/commands/import Usage: terraform import [options] ADDRESS ID Import will find the existing resource from ID and import it into your Terraform state at the given ADDRESS. ADDRESS must be a valid resource address. Because any resource address is valid, the import command can import resources into modules as well as directly into the root of your state. ID is dependent on the resource type being imported. If the ID is invalid, you'll just receive an error message. Warning: Terraform expects that each remote object it is managing will be bound to only one resource address, which is normally guaranteed by Terraform itself having created all objects. If you import existing objects into Terraform, be careful to import each remote object to only one Terraform resource address. If you import the same object multiple times, Terraform may exhibit unwanted behavior.
upvoted 1 times
...
...
Clapton79
Most Recent 1 year ago
Selected Answer: D
Latest version of Terraform can import as part of apply in case you have import {} clauses. Since this is not part of the answers, explicit call remains, answer D.
upvoted 1 times
...
Power123
1 year, 7 months ago
Correct answer is D
upvoted 1 times
...
0ptimus
2 years, 2 months ago
Selected Answer: D
D is correct. I have tested it.
upvoted 2 times
...
Ahmad_Terraform
2 years, 4 months ago
By an explicit call
upvoted 3 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 ...