resource address
The type and name of a resource joined by a dot, such as local_file.greeting, which identifies it everywhere.
In more detail
You see addresses in plans, in state, in error messages and in commands that act on one resource. Instances created with count or for_each add an index or key, as in null_resource.subnet["a"], and resources inside modules are prefixed with module and the module name. Changing an address makes Terraform see a different object, which can cause a replacement.
Examples
local_file.greetingmodule.network.null_resource.subnet["a"]Related terms
- Terraform resource — A resource block, which asks Terraform to create and manage one piece of infrastructure such as a network, file or database.
- resource instance — One of the objects a resource block produces; a block with count or for_each has several, each with its own index or key.
- resource attribute — A value you can read off a resource's address, either an argument you set or one the provider fills in, such as local_file.greeting.id.
Taught in
- Writing Your First Configuration In HCL — Infrastructure as Code with Terraform
- Tearing It Down With Destroy — Infrastructure as Code with Terraform
- Scaling Resources With Count — Infrastructure as Code with Terraform
- Iterating Over Maps With For Each — Infrastructure as Code with Terraform
- The Plan That Wanted To Destroy Production — HashiCorp Terraform Associate (004) Exam Prep
- Infrastructure As Code, And One Workflow For Every Platform — HashiCorp Terraform Associate (004) Exam Prep
- Providers: How Terraform Reaches Every API — HashiCorp Terraform Associate (004) Exam Prep
- Versions, The Lock File And Provider Aliases — HashiCorp Terraform Associate (004) Exam Prep
- State: Terraform's Memory Of What It Built — HashiCorp Terraform Associate (004) Exam Prep
- Validate, Format, Destroy, And The Flags That Bend A Plan — HashiCorp Terraform Associate (004) Exam Prep
- Resources, Data Sources And The References Between Them — HashiCorp Terraform Associate (004) Exam Prep
- Count, For Each And Dynamic Blocks — HashiCorp Terraform Associate (004) Exam Prep