Interview Prep/Terraform/Workflow and CLI

What are "known after apply" and unknown values, and why do they limit what you can do?

AdvancedConceptWorkflow and CLI
Answer

Unknown values are attributes the provider cannot compute until the resource exists, such as an instance ID. Terraform tracks them through the plan, but cannot use them where it must know the value to build the graph, such as count or for_each keys, or resource addresses. That is why for_each = toset(aws_instance.x[*].id) fails and you key by static values instead.

All Terraform questions Roadmap: Terraform

More on Workflow and CLI