Automatic References
When you access a property on a resource object, tfts returns a Token. This token represents a value that will only be known during synthesis or after Terraform runs. For example, if you have a Google Cloud Storage bucket and you want to use its name in another resource:The Token System
Tokens are placeholders for values. They allow tfts to handle lazy evaluation. When you passbucket.name to another resource, you aren’t passing a string; you are passing a Token object that tfts knows how to serialize into the correct Terraform reference syntax (${...}).
Lazy Evaluation
Because values are represented as tokens, the order in which you define resources in your TypeScript code doesn’t strictly dictate the order in the generated Terraform JSON. tfts tracks dependencies through these tokens to ensure Terraform understands the relationship between resources.Cross-Resource References
References can span across different types of resources. This is the primary way to build complex infrastructure graphs.String Interpolation
Sometimes you need to combine a reference with other text. tfts supports string interpolation with tokens.bucketUrl will be converted to the Terraform equivalent: "gs://${google_storage_bucket.data.name}/uploads".
Explicit Dependencies
While tokens handle most dependencies automatically, you can explicitly define dependencies using thedependsOn property available on all resources if a relationship isn’t captured by a direct attribute reference.