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.
In more detail
Attributes the provider sets, such as identifiers or checksums, are unknown until the resource has been created, so plans show them as known after apply. Reading an attribute from another resource creates a dependency between the two.
Examples
local_file.greeting.filenameaws_vpc.main.idRelated terms
- resource address — The type and name of a resource joined by a dot, such as local_file.greeting, which identifies it everywhere.
- known after apply — What a plan shows for a value that cannot exist until apply, such as an identifier or checksum the provider will generate.
- resource reference — An expression such as aws_vpc.main.id that reads a value from another block by its address.
Taught in
- Writing Your First Configuration In HCL — Infrastructure as Code with Terraform
- Predicting Changes, Then Applying Them — Infrastructure as Code with Terraform
- State: Terraform's Memory Of What It Built — HashiCorp Terraform Associate (004) Exam Prep
- Resources, Data Sources And The References Between Them — HashiCorp Terraform Associate (004) Exam Prep
- Complex Types: Lists, Sets, Maps, Objects And Tuples — HashiCorp Terraform Associate (004) Exam Prep
- Expressions And Functions: Making Configuration Compute — HashiCorp Terraform Associate (004) Exam Prep
- Count, For Each And Dynamic Blocks — HashiCorp Terraform Associate (004) Exam Prep
- Dependencies, depends_on And Lifecycle Rules — HashiCorp Terraform Associate (004) Exam Prep
- Custom Conditions: Validation, Pre And Postconditions, Checks — HashiCorp Terraform Associate (004) Exam Prep
- Module Scope: What Goes In, What Comes Out — HashiCorp Terraform Associate (004) Exam Prep