Pending<T> type system. Writing unit.aws_rds_instance.db.endpoint directly as a block attribute value marks it as Pending<T> — a value that doesn’t exist yet at compile time but will exist at apply time. ubx tracks these pending values through the compilation pipeline and generates the correct Pulumi Output<T>.apply() chains so that Pulumi automatically waits for the database to exist before deploying the Helm chart. No scripts. No secret stores. No glue.
What you’ll learn
- The
Pending<T>type system — ubx’s core innovation - How infrastructure outputs flow automatically into application configuration
- How ubx compiles
Pending<T>references to PulumiOutput<T>.apply()chains
Why this matters
The
Pending<T> system isn’t just about convenience — it’s a correctness guarantee. By expressing the dependency in the language, ubx ensures Pulumi can never deploy the Helm chart before the database is ready. There’s no race condition, no “apply twice”, no manual ordering.The source code
How it works
Resource output references are Pending<T>
unit.aws_rds_instance.db.endpoint is a resource output reference — ubx classifies it as Pending<string> because it only exists after Pulumi has created the RDS instance. The compiler tracks this classification through the entire deploy block.Pending propagates through the block
Because
database.host is Pending<T>, the entire values object becomes Pending<T>. ubx records the deploy block’s pending refs — the specific values that drive the generated .apply() wrapping.The IR pass classifies every property
During AST → IRProgram, each property is marked
Pending: true or Pending: false. The emitter uses this classification to decide which resources need .apply() chains and which are plain constructors.What ubx generates
Common mistakes
Run it
What you learned
Resource output references (
unit.*, component.*, data.*) are Pending<T> — they resolve at apply time, not compile timePending<T> propagates through block values automaticallyubx generates correct Pulumi
Output<T>.apply() chains — no manual depends_on neededInfrastructure outputs wire directly into application config with zero manual steps
Next steps
Conditional expressions
Use
??, if/else, switch, and morePending type concept
Deep dive into the Pending<T> type system
Full runnable example: github.com/ubiquex/ubx-examples/04-pending-refs-rds-to-helm

