Detailed Explanation:
Rationale for Correct Answer:Terraform’s import block (introduced in newer versions) requires two essential pieces of information:
A. Resource address – This specifies where in Terraform configuration the imported resource will be mapped (e.g., aws_db_instance.example).
C. Resource ID – This is the unique identifier used by the provider to locate the existing infrastructure (e.g., database ID in AWS, Azure, etc.).
These two elements allow Terraform to associate an existing real-world resource with a resource block in your configuration, aligning with the objective of managing existing infrastructure using Terraform.
Analysis of Incorrect Options (Distractors):
B. Path to the .tf file Incorrect because Terraform does not require file paths; it works with resource addresses defined in configuration.
D. Database platform and version Incorrect because this information may exist in configuration but is not required for the import operation itself.
E. Connection string Incorrect because Terraform uses provider APIs, not direct connection strings, to manage infrastructure.
Key Concept: Importing existing infrastructure requires a resource address and provider-specific resource ID.
[Reference: Terraform Objective Domain: Manage Terraform Resources and Providers, , , , , ]
Submit