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
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.
090200f
3 months, 3 weeks agoheeloco
1 year, 2 months agoPete987
1 year, 3 months ago