TfType class sealed

A Terraform type constraint: string, list(number), object({ name = string }).

Stack.variable derives it from the handle's Dart type — String, int / double / num, bool, and List / Set / Map<String, _> of those — so type: is only needed for what Dart cannot say:

final labels = variable<Map<String, String>>('labels');
final service = variable<Object?>(
  'service',
  type: .object({'name': .string, 'port': .optional(.number, 8080)}),
);

Constructors

TfType.list(TfType element)
list(<element>).
const
factory
TfType.map(TfType element)
map(<element>).
const
factory
TfType.object(Map<String, TfType> attributes)
object({ <name> = <type>, ... }); an attribute may be optional.
const
factory
TfType.optional(TfType type, [Object? defaultValue])
optional(<type>[, <default>]), an object attribute the caller may leave out.
const
factory
TfType.set(TfType element)
set(<element>).
const
factory
TfType.tuple(List<TfType> elements)
tuple([<type>, ...]).
const
factory

Properties

expression → String
The constraint as Terraform writes it, which is also its tf.json form.
no setter
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.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

any → const TfType
Terraform any: the value decides the type.
bool → const TfType
Terraform bool.
number → const TfType
Terraform number.
string → const TfType
Terraform string.