From 33dfeecbeefc745b93ceea8d9a614a9e754de6b8 Mon Sep 17 00:00:00 2001 From: kmoe <5575356+kmoe@users.noreply.github.com> Date: Tue, 21 Nov 2023 08:35:26 +0000 Subject: [PATCH] docs: more detail on import IDs (#34153) --- website/docs/language/import/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/language/import/index.mdx b/website/docs/language/import/index.mdx index d9769fcc3c..a9f91f15eb 100644 --- a/website/docs/language/import/index.mdx +++ b/website/docs/language/import/index.mdx @@ -36,14 +36,14 @@ The above `import` block defines an import of the AWS instance with the ID "i-ab The `import` block has the following arguments: - `to` - The instance address this resource will have in your state file. - - `id` - A string with the [import ID](#import-id) of the resource. + - `id` - A string with the [import ID](#import-id) of the resource, or an expression that evaluates to a string. - `provider` (optional) - An optional custom resource provider, see [The Resource provider Meta-Argument](/terraform/language/meta-arguments/resource-provider) for details. If you do not set the `provider` argument, Terraform attempts to import from the default provider. ### Import ID -The import block's `id` argument can be a literal string of your resource's import ID, or an expression that evaluates to a string. Terraform needs this import ID to locate the resource you want to import. +The import block's `id` argument can be a literal string of your resource's import ID, or an expression that evaluates to a string, such as `var.instance_id`. Terraform needs this import ID to locate the resource you want to import. The import ID must be known at plan time for planning to succeed. If the value of `id` is only known after apply, `terraform plan` will fail with an error.