resource reference
An expression such as aws_vpc.main.id that reads a value from another block by its address.
In more detail
A reference is how one block uses another's value, and it also tells Terraform that the second must be created after the first. You never write the order yourself; references are the order.
Example
vpc_id = aws_vpc.main.idRelated terms
- implicit dependency — An ordering between two resources that Terraform works out for itself because one refers to the other.
- resource address — The type and name of a resource joined by a dot, such as local_file.greeting, which identifies it everywhere.
- dependency graph — Terraform's internal map of every resource, data source and value in a configuration, linked by which depends on which.
Taught in
- What Is Infrastructure As Code? — Infrastructure as Code with Terraform
- Writing Your First Configuration In HCL — Infrastructure as Code with Terraform
- Functions And Expressions In HCL — Infrastructure as Code with Terraform
- Querying Existing Infrastructure With Data Sources — Infrastructure as Code with Terraform
- Reading A Plan, Saving It, Applying It — HashiCorp Terraform Associate (004) Exam Prep