internal library

Building blocks for tools that generate or read TerraDart code — the terradart wrap generator and terradart-migrate. A Stack does not need them, and they change without a deprecation period.

Classes

TfJsonEncoder
Synth-time JSON encoder: builds the JSON structure for main.tf.json.

Functions

goDurationString(Duration d) → String
d as the Go duration string Terraform reads: hours, minutes, seconds, milliseconds and microseconds, each unit only when it is not zero (Duration(minutes: 90) is 1h30m, zero is 0s).
hasTemplateSequence(String template) → bool
True when template holds at least one unescaped ${ ... } or %{ ... } sequence — Terraform evaluates it; a string without one is a plain value ($${ and %%{ are the escaped, literal forms).
outputEnvironmentName(String name) → String
The environment variable that carries the output name: ORDERS_TOPIC_ID for orders_topic_id, ordersTopicId or orders-topic-id.
parseGoDuration(String text) → Duration?
The Duration a Go duration string ('30m', '1h30m', '1.5s') is, or null when text is not one, or is finer than a microsecond.
templateVariableNames(String template) → Set<String>
The names of the var.<name> references inside the sequences of template, in order of first appearance. $${ / %%{ escapes are literal text and the contents of quoted strings inside a sequence are ignored, except for sequences nested in them ("${lower("${var.x}")}").