TfJsonEncoder class
Synth-time JSON encoder: builds the JSON structure for main.tf.json.
Each public static returns a JSON-serialisable Dart value (no
TfArg / TfRef instances escape — they're collapsed to strings or
scalars). The orchestrator in stack_synth.dart glues these together
into the top-level map.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
blockProvider(
Resource r) → String? -
The block's
providermeta-argument: its Resource.provider, else its Resource.defaultProvider when that is not the type's implied prefix provider, elsenull. -
dataGroup(
Stack stack) → Map< String, dynamic> ? -
Top-level
data { ... }group. A data source carries itsproviderandtimeoutsmeta-arguments like a resource; it has nolifecycle/depends_on/ sensitive masking at v0.0.x — Terraform rejectslifecycleon data blocks anyway. -
dependsOn(
List< TfAddressed> deps) → List<String> ? -
depends_on = [...]list of bare addresses, ornullwhen empty. -
encodeArg(
TfArg arg) → Object? -
Encode a single
TfArginto a JSON-serialisable value. -
encodeArgMap(
Map< String, TfArg?> argMap) → Map<String, Object?> -
Encode a full argMap; drops keys whose value is
null(optional unset fields) or whose literal payload encodes tonull. -
encodeBareAddress(
TfRef ref) → String -
For positions where Terraform expects a bare resource address (no
${...}interpolation):replace_triggered_by,depends_on. Delegates toTfRef.bareAddress. -
lifecycleBlock(
LifecycleOptions opts) → Map< String, dynamic> ? -
lifecycle { ... }nested block, ornullwhen no fields are set. -
moduleGroup(
Stack stack) → Map< String, dynamic> ? -
Top-level
module { ... }group, keyed by the call's local name:source(andversion) first, then the module's inputs, then the meta-arguments. Returnsnullwhen the stack registers no call. -
movedBlock(
Stack stack) → List< Map< ?String, String> > -
Top-level
movedlist — one{"from": ..., "to": ...}object per Stack.addMoved entry, in registration order — ornullwhen the stack recorded none. -
providerBlock(
Stack stack) → Map< String, dynamic> ? -
The top-level
provider { ... }value, ornullwhen no block is needed. -
providerReference(
StackProvider p) → String -
googleorgoogle.eu: the value a resource'sprovidermeta-argument uses to selectp. -
replaceTriggerAddress(
ReplaceTrigger trigger) → String -
The bare address
replace_triggered_bylists fortrigger: a resource's address or an attribute reference's. -
resourceBlock(
Resource r, {bool devModeInjectDeletionProtection = false}) → Map< String, dynamic> -
JSON for one resource block:
argMap+ optionaldepends_on+ optionallifecycle+ optionaltimeouts. -
resourcesGroup(
Stack stack) → Map< String, dynamic> ? -
Top-level
resource { ... }group, keyed by terraform type then local name. Returnsnullwhen the stack has no resources. -
terraformBlock(
Stack stack) → Map< String, dynamic> -
The top-level
terraform { ... }block:required_version,required_providers, optionalbackend. -
variableBlock(
Stack stack) → Map< String, dynamic> ? -
The top-level
variable { ... }value, ornullwhen the stack declares none (Terraform rejects an emptyvariableblock).
Constants
- defaultRequiredVersion → const String
-
>= 1.11.0is the default required Terraform version because curated factories (notably Secret Manager'ssecret_data_wo) depend on Terraform 1.11+ write-only arguments. Override viaStack(requiredVersion: ...)if your stack does not need them.