Skip to content

Commit b59a435

Browse files
committed
moved resource identity concept to overview page
1 parent a7883bb commit b59a435

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

content/terraform/v1.14.x (alpha)/docs/language/import/bulk.mdx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,10 @@ For organizations with large sets of infrastructure resources, manually identify
1414
Complete the following steps to find and import resources in bulk:
1515

1616
- Search for resources: Create `list` blocks to search for existing resources.
17-
- Generate configuration: Use the Terraform command to generate `resource` and `import` blocks for importing the resources. The configuration also includes the [resource identity](#resource-identity).
18-
17+
- Generate configuration: Use the Terraform command to generate `resource` and `import` blocks for importing the resources. The configuration also includes the [resource identity](/terraform/language/import#resource-identity).
1918
- Import resources: Copy the generated configuration into your main.tf file and run a `terraform apply` command to import the resources.
2019
- After importing resources, you can remove the generated `import` block or keep it as an historical record.
2120

22-
### Resource identity
23-
24-
Terraform uniquely identifies resources according to either the ID assigned by the cloud provider or a collection of specific attributes defined by the provider. For example, the `s3_bucket` resource available in the AWS provider uniquely identifies buckets according to the following attributes:
25-
26-
- `account_id`
27-
- `bucket`
28-
- `region`
29-
30-
Refer to your provider documentation for information about resource identities.
3121

3222
## Requirements
3323

content/terraform/v1.14.x (alpha)/docs/language/import/index.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,17 @@ When you need to identify and import large sets of infrastructure resources, you
2222
The workflow for importing single resources or small batches of resources works best when you can easily access unique infrastructure resource IDs and other attributes from your cloud provider. In this workflow, manually write `import` and `resource` blocks and run the `terraform apply` command to import the resources.
2323

2424
Alternatively, you can write only the `import` block and run the `terraform plan` command with the `generate-config-out` flag to generate the `resource` blocks. Refer to [Import a single resource](/terraform/language/import/single-resource) for more information.
25+
26+
## Resource identity
27+
28+
Terraform uniquely identifies resources according to either the ID assigned by the cloud provider or a collection of specific attributes defined by the provider. To reference a resource identity in Terraform configuration, you can use either `id` or `identity` attribute.
29+
30+
The `identity` attribute for `s3_bucket` resources available in the AWS provider, for example, uniquely identifies buckets according to the following attributes:
31+
32+
- `account_id`
33+
- `bucket`
34+
- `region`
35+
36+
To reference the unique identity of an `aws_instance` resource, you can use the `id` attribute.
37+
38+
Refer to your provider documentation for information about how to reference resource identities. For information about referencing resource identities in Terraform configuration, refer to the [`import` block reference](/terraform/language/block/import).

content/terraform/v1.14.x (alpha)/docs/language/import/single-resource.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You can include [meta-arguments](/terraform/language/meta-arguments) to modify h
4848

4949
## Define an `import` block
5050

51-
Add an `import` block and specify the ID of an existing resource and [destination resource address](#define-a-destination-resource) to import to. Cloud providers use different methods of identifying resources. As a result, the ID depends on your cloud vendor and the kind of resource you are importing. Refer to the provider documentation for the resource you want to import for details.
51+
Add an `import` block and specify the [resource identity](/terraform/language/import#resource-identity) of an existing resource and [destination resource address](#define-a-destination-resource) to import to. Cloud providers use different methods of identifying resources. As a result, the identity depends on your cloud vendor and the kind of resource you are importing. Refer to the provider documentation for the resource you want to import for details.
5252

5353
Use the following syntax to configure the `import` block:
5454

0 commit comments

Comments
 (0)