Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 275


Which command adds existing resources into Terraform state?

Show Answer
Correct Answer: D

The command that adds existing resources into Terraform state is 'terraform import'. This command is specifically designed to import existing resources into Terraform's state, enabling Terraform to manage those resources moving forward.

Discussion

3 comments
Sign in to comment
Pete987
Aug 23, 2023

D: terraform import

heelocoOption: D
Sep 21, 2023

agree Pete987

090200fOption: D
Aug 3, 2024

yes, only terraform import can add exiting resources into terraform state file. terraform init : - The terraform init command initializes a working directory containing Terraform configuration files. This is the first command that should be run after writing a new Terraform configuration or cloning an existing one from version control. It is safe to run this command multiple times. terraform plan :- The terraform plan command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure. terraform import :- The terraform import command imports existing resources into Terraform. 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. terraform refresh :- The terraform refresh command reads the current settings from all managed remote objects and updates the Terraform state to match. so only terraform import, option D is correct answer