TA-002-P · Question #338
Which parameters does terraform import require? Choose two correct answers.
The correct answer is C. Resource address D. Resource ID. The terraform import command is used to bring existing infrastructure under Terraform management, requiring both the Terraform resource address to map it to and the cloud provider's ID of the actual resource. These two parameters tell Terraform which existing resource to import…
Question
Which parameters does terraform import require? Choose two correct answers.
Options
- AProvider
- BPath
- CResource address
- DResource ID
How the community answered
(24 responses)- A4% (1)
- B4% (1)
- C92% (22)
Why each option
The `terraform import` command is used to bring existing infrastructure under Terraform management, requiring both the Terraform resource address to map it to and the cloud provider's ID of the actual resource. These two parameters tell Terraform which existing resource to import and where to place it within the state.
The `provider` is implicitly determined by the resource address being imported (e.g., `aws_instance` implies the AWS provider) and is not a direct parameter to the `import` command itself.
`Path` is not a direct parameter for `terraform import`; instead, `resource address` refers to the logical path within the Terraform configuration.
The `terraform import` command requires two main arguments: the `resource address` (e.g., `aws_instance.webserver`) which specifies where the resource should be mapped in the Terraform state, and the `resource ID` (e.g., `i-0123456789abcdef0`) which is the unique identifier of the existing resource in the cloud provider. Together, these allow Terraform to accurately add the existing resource to its state file.
The `terraform import` command requires two main arguments: the `resource address` (e.g., `aws_instance.webserver`) which specifies where the resource should be mapped in the Terraform state, and the `resource ID` (e.g., `i-0123456789abcdef0`) which is the unique identifier of the existing resource in the cloud provider. Together, these allow Terraform to accurately add the existing resource to its state file.
Concept tested: Terraform import command syntax
Source: https://developer.hashicorp.com/terraform/cli/commands/import
Topics
Community Discussion
No community discussion yet for this question.