Which command adds existing resources into Terraform state?
Which command adds existing resources into Terraform state?
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.
D: terraform import
agree Pete987
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