Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 246

When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?

    Correct Answer: A

    To import existing infrastructure into Terraform, you must first write the corresponding Terraform resource block in your configuration files. This block establishes how the resource will be known and managed in Terraform. Once the configuration is written, you can then use the terraform import command to associate the existing resource with this configuration. Terraform does not automatically generate configuration files for existing resources, hence it is essential to create these files beforehand.

Discussion
Ni33Option: A

A is the correct answer !

MarshalLawOption: D

D: You can use the import command to migrate existing resources into your Terraform state file. The import command does not currently generate the configuration for the imported resource, so you must write the corresponding configuration block to map the imported resource to it. Importing infrastructure involves five steps: 1 Identify the existing infrastructure you will import. 2 Import infrastructure into your Terraform state file. 3 Write Terraform configuration that matches that infrastructure. 4 Review the Terraform plan to ensure the configuration matches the expected state and infrastructure. 5 Apply the configuration to update your Terraform state. Source: https://developer.hashicorp.com/terraform/tutorials/state/state-import

[Removed]

Answer is A. Source: https://developer.hashicorp.com/terraform/tutorials/state/state-import. Has been updated with new steps for Terraform v1.5 Using configuration to import resources involves the following steps: Identify the existing infrastructure you will import. Define an import block for the resources. Run terraform plan to review the import plan and optionally generate configuration for the resources. Prune generated configuration to only the required arguments. Apply the configuration to bring the resource into your Terraform state file.

joyboy23

But that is your "Import config", It is not the "existing infra config"

dbrosowskiCWOption: A

A: You need to have the corresponding resources defined in your Terraform configuration files before you can import them.

Oleg_golOption: D

D. After you run terraform import

Blitz123Option: B

as per terraform 1.0 which is the latest version for exam its B. You can import infrastructure without corresponding Terraform code

arunrkaushikOption: A

You cannot import the resource unless the resource's basic block is not coded in the .tf file. Hence this is the 1st step. Once a basic block is written, you import the resources and enhance the code using the state details. <b> Before you run terraform import </b>

seifsklOption: A

Please refer to this link https://developer.hashicorp.com/terraform/cli/import/usage It is said: "To import a resource, first write a resource block for it in your configuration, establishing the name by which it will be known to Terraform ... Now terraform import can be run to attach an existing instance to this resource configuration"

lukacs16Option: A

"To import a resource, first write a resource block for it in your configuration, establishing the name by which it will be known to Terraform" Answer is A. https://developer.hashicorp.com/terraform/cli/import/usage

Foram31Option: D

1. Run terraform import to bring the existing resources under Terraform management. This command allows you to import the existing resources into the Terraform state without the corresponding Terraform configuration files. 2.After importing the resources, you should write the Terraform configuration files to define and manage the imported resources. These configuration files specify the desired state of the infrastructure and allow you to make changes to it in a controlled manner.

sdm13168Option: A

https://spacelift.io/blog/importing-exisiting-infrastructure-into-terraform

SathisgmOption: D

Answer is D

blop213Option: A

If D is right then B is necesarry right, and since its not multiple choice, it can only be A Right answer : A

TricejerOption: A

A is correct

uaxOption: A

When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform? A. Before you run terraform import.

AdriBFKOption: A

Tested

yubacOption: A

Condidering and existing infrastructurre on a cloud provider, in order to manage these resources on terraform you need: 1. foreach resource, add at least the resources definition using resource_type.resource_name {} 2. foreach resource, use terraform import resource_type.resource_name <id>

Sydurrahman12

which one right A or D?