You created infrastructure outside the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?
The terraform import command allows Terraform to takeexistinginfrastructure andbring it under Terraform’s management.
A (terraform get)is incorrect because it is used to fetch modules.
B (terraform refresh)is incorrect because it only updates Terraform's state to match the infrastructure but does not import resources.
D (terraform init)is incorrect because it only initializes the Terraform working directory.
Official Terraform Documentation Reference:
terraform import - HashiCorp Documentation
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit