workers library
Cloudflare Workers scripts, routes, KV, and Workers for Platforms.
Classes
-
AppConstant<
T> -
A value the Stack hands to application code as a
static constin the generated AppExports file — known when synth runs, so the app compiles against it. - AppExports
-
Where synth writes the Dart file application code imports: the Stack's
constants, as the
static constmembers of<name>Constants, and a typed reader of its Terraform outputs,<name>Outputs. -
AttributeRef<
T> -
Public for sealed pattern matching, but constructor is private — only
TfRef.attribute()may construct instances. - CloudflareWorker
-
Factory wrapper for
cloudflare_worker. - CloudflareWorkersCronTrigger
-
Factory wrapper for
cloudflare_workers_cron_trigger. - CloudflareWorkersCustomDomain
-
Factory wrapper for
cloudflare_workers_custom_domain. - CloudflareWorkersDeployment
-
Factory wrapper for
cloudflare_workers_deployment. - CloudflareWorkersForPlatformsDispatchNamespace
-
Factory wrapper for
cloudflare_workers_for_platforms_dispatch_namespace. - CloudflareWorkersKv
-
Factory wrapper for
cloudflare_workers_kv. - CloudflareWorkersKvNamespace
-
Factory wrapper for
cloudflare_workers_kv_namespace. - CloudflareWorkersRoute
-
Factory wrapper for
cloudflare_workers_route. - CloudflareWorkersScript
-
Factory wrapper for
cloudflare_workers_script. - CloudflareWorkersScriptSubdomain
-
Factory wrapper for
cloudflare_workers_script_subdomain. - CloudflareWorkerVersion
-
Factory wrapper for
cloudflare_worker_version. - DartDefineOutput
-
An
outputwhose value is the client build's--dart-definefile, registered withStack.addDartDefineOutput. - Data
-
Base of every user-instantiable Terraform
datablock. - DataCloudflareWorker
-
Factory wrapper for
cloudflare_worker. - DataCloudflareWorkers
-
Factory wrapper for
cloudflare_workers. - DataCloudflareWorkersCronTrigger
-
Factory wrapper for
cloudflare_workers_cron_trigger. - DataCloudflareWorkersCustomDomain
-
Factory wrapper for
cloudflare_workers_custom_domain. - DataCloudflareWorkersCustomDomains
-
Factory wrapper for
cloudflare_workers_custom_domains. - DataCloudflareWorkersDeployment
-
Factory wrapper for
cloudflare_workers_deployment. - DataCloudflareWorkersDeployments
-
Factory wrapper for
cloudflare_workers_deployments. - DataCloudflareWorkersForPlatformsDispatchNamespace
-
Factory wrapper for
cloudflare_workers_for_platforms_dispatch_namespace. - DataCloudflareWorkersForPlatformsDispatchNamespaces
-
Factory wrapper for
cloudflare_workers_for_platforms_dispatch_namespaces. - DataCloudflareWorkersKv
-
Factory wrapper for
cloudflare_workers_kv. - DataCloudflareWorkersKvNamespace
-
Factory wrapper for
cloudflare_workers_kv_namespace. - DataCloudflareWorkersKvNamespaces
-
Factory wrapper for
cloudflare_workers_kv_namespaces. - DataCloudflareWorkersRoute
-
Factory wrapper for
cloudflare_workers_route. - DataCloudflareWorkersRoutes
-
Factory wrapper for
cloudflare_workers_routes. - DataCloudflareWorkersScript
-
Factory wrapper for
cloudflare_workers_script. - DataCloudflareWorkersScripts
-
Factory wrapper for
cloudflare_workers_scripts. - DataCloudflareWorkersScriptSubdomain
-
Factory wrapper for
cloudflare_workers_script_subdomain. - DataCloudflareWorkerVersion
-
Factory wrapper for
cloudflare_worker_version. -
DataRef<
T> -
Public for sealed pattern matching, but constructor is private — only
TfRef.data()may construct instances. - DataWorkerFilter
-
Typed helper for the
filterblock ofcloudflare_worker(derived from provider schema). - DataWorkersCustomDomainFilter
-
Typed helper for the
filterblock ofcloudflare_workers_custom_domain(derived from provider schema). - DataWorkersKvNamespaceFilter
-
Typed helper for the
filterblock ofcloudflare_workers_kv_namespace(derived from provider schema). - DataWorkersScriptFilter
-
Typed helper for the
filterblock ofcloudflare_workers_script(derived from provider schema). - EnvironmentConstant
- The AppConstant.fromEnvironment choice.
- GcsBackend
-
terraform { backend "gcs" { ... } }configuration. - IgnoreAllChanges
- IgnoreChanges.all.
- IgnoreAttributes
- IgnoreChanges.of.
- IgnoreChanges
-
What
ignore_changescovers: every attribute, or the listed ones. - InvalidDartDefineOutput
-
An output of
Stack.addDartDefineOutputthat cannot carry what it names: an output that is not registered, is sensitive or has no environment value, two outputs read from one variable, or no output at all. - InvalidLifecycle
-
A
lifecycleblock Terraform rejects: a data source (or one of its attributes) inreplaceTriggeredBy,allinside IgnoreChanges.of, or a condition with an empty error message. - InvalidMoveTarget
-
A
movedblock whosetonames no resource of the Stack. - InvalidTimeout
-
A negative
timeoutsduration. - LifecycleCondition
-
A
preconditionorpostconditionblock: Terraform fails the plan (LifecycleCondition.pre) or the apply (LifecycleCondition.post) with errorMessage when condition is false. - LifecycleOptions
-
lifecycle { ... }block on a resource. - LocalBackend
-
terraform { backend "local" { ... } }configuration. - MissingProvider
-
A block needs a provider configuration the Stack does not register:
the provider its type implies (
googleforgoogle_pubsub_topic), the one itsprovidermeta-argument names, or one a module call passes on. - ModuleCall
-
A
module "<localName>" { ... }call as a Dart value. - NoProviders
- The Stack registers no provider, but declares resources or data sources.
- ProviderConflict
- Two provider registrations Terraform rejects together: two defaults of one name, a repeated alias, an alias that is not an identifier, or configurations of one name with different source / version constraints.
-
RefConstant<
T> - The AppConstant.ref choice.
- ReplaceTrigger
-
What
lifecycle.replaceTriggeredBylists: a resource of the Stack or an attribute getter of one.Resourceand TfRef implement it; synth reports a data source or a data-source attribute as anInvalidLifecycle. - Resource
- Base of every user-instantiable Terraform resource.
- ResourceRef
-
Public for sealed pattern matching, but constructor is private — only
TfRef.resource()may construct instances. - S3Backend
-
terraform { backend "s3" { ... } }configuration. -
Sensitive<
T> -
What an argument Terraform marks sensitive takes: a variable, an
expression or an attribute getter — a value Terraform resolves, never a
Dart literal that would be written into
main.tf.json. - SensitiveLiteral
-
A sensitive field is set to a literal, which would write the secret in
plain text into
main.tf.json. - Stack
- User-extended IaC composition root.
- StackBackend
-
Lightweight backend hook. Core ships
GcsBackend,S3Backend, andLocalBackend; anything else implements this interface in the caller. TheStackonly stores the value and exposes a discriminator for synth'sterraform { backend ... }emitter. - StackProvider
-
Coordination interface between
Stack(in this package) and concrete providers (e.g.GoogleProviderinterradart_google). Concrete providers implement every getter using their baked-in constants from Stage 2 codegen. - SynthIssue
- One reason a Stack cannot be synthesized.
- SynthResult
-
Bundle returned by
StackSynth.synth. - TfAddressed
-
Anything that exposes a Terraform address, e.g.
google_pubsub_topic.orders. -
TfArg<
T> - A Terraform argument: a Dart-side literal, a reference to another block's attribute (TfRef), a variable or a raw expression.
-
TfArgExpression<
T> - A raw Terraform expression — the tf.json template string, verbatim.
-
TfArgLiteral<
T> -
TfArgVariable<
T> - TfCollectionType
-
list(...),set(...)ormap(...). - TfMoved
-
One
moved { from = ... to = ... }block: the state object at from now belongs to the resource at to, so a rename does not become a destroy-and-create. - TfObjectType
-
object({ ... }). - TfOptionalType
-
optional(<type>[, <default>]). -
TfOutput<
T> -
An
output "<name>" { value = ... }block, registered withStack.addOutput. - TfPrimitiveType
-
string,number,boolorany. -
TfRef<
T> - A Terraform-side reference: an attribute of a resource (AttributeRef) or a data source (DataRef), or a whole resource (ResourceRef).
- TfTimeouts
-
timeouts { ... }on a resource or data source: how long Terraform waits for each operation before giving up. - TfTupleType
-
tuple([...]). - TfType
-
A Terraform type constraint:
string,list(number),object({ name = string }). - TfVariable
-
One
variable "<name>" { ... }declaration. - UndeclaredVariable
-
A
TfArg.variableorvar.<name>in an expression names a variable the Stack does not declare. - UnregisteredReference
-
A block references another block that was never registered on the
Stack: built, but not passed to
add(...)/addModule(...). - UnresolvableConstant
-
An
AppConstant.refwhose value is not known at synth: the attribute is not set to a literal, is sensitive, does not match the constant's type, or belongs to a block that is not registered. -
ValueConstant<
T> - The AppConstant.value choice.
- WorkerCacheOptions
-
Typed helper for the
previews_base_config.cache_optionsblock ofcloudflare_worker(derived from provider schema). - WorkerEnv
-
Typed helper for the
previews_base_config.envblock ofcloudflare_worker(derived from provider schema). - WorkerIssues
-
Typed helper for the
observability.issuesblock ofcloudflare_worker(derived from provider schema). Shared by every block of this shape in the resource. - WorkerLimits
-
Typed helper for the
previews_base_config.limitsblock ofcloudflare_worker(derived from provider schema). - WorkerLogs
-
Typed helper for the
observability.logsblock ofcloudflare_worker(derived from provider schema). Shared by every block of this shape in the resource. - WorkerObservability
-
Typed helper for the
observabilityblock ofcloudflare_worker(derived from provider schema). - WorkerPlacement
-
Typed helper for the
previews_base_config.placementblock ofcloudflare_worker(derived from provider schema). - WorkerPreviewsBaseConfig
-
Typed helper for the
previews_base_configblock ofcloudflare_worker(derived from provider schema). - WorkerPreviewsBaseConfigObservability
-
Typed helper for the
previews_base_config.observabilityblock ofcloudflare_worker(derived from provider schema). - WorkersCronTriggerSchedules
-
Typed helper for the
schedulesblock ofcloudflare_workers_cron_trigger(derived from provider schema). - WorkersDeploymentAnnotations
-
Typed helper for the
annotationsblock ofcloudflare_workers_deployment(derived from provider schema). - WorkersDeploymentVersions
-
Typed helper for the
versionsblock ofcloudflare_workers_deployment(derived from provider schema). - WorkersScriptAnnotations
-
Typed helper for the
annotationsblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptAssets
-
Typed helper for the
assetsblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptBindings
-
Typed helper for the
bindingsblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptCache
-
Typed helper for the
exports.cacheblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptCacheOptions
-
Typed helper for the
cache_optionsblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptConfig
-
Typed helper for the
assets.configblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptContent
-
At most one of
content,content_fileoncloudflare_workers_script: the provider rejects more than one, so each variant sets one of them and a null choice sets none. - WorkersScriptContentChoice
-
The WorkersScriptContent.content choice: sets
content. - WorkersScriptContentFile
-
The WorkersScriptContent.contentFile choice: sets
content_file. - WorkersScriptExports
-
Typed helper for the
exportsblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptFiles
-
Typed helper for the
filesblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptFilesContent
-
Exactly one of
content_base64,content_fileon thefilesblock ofcloudflare_workers_script: the provider rejects none and more than one, so each variant sets one of them. - WorkersScriptFilesContentBase64
-
The WorkersScriptFilesContent.contentBase64 choice: sets
content_base64. - WorkersScriptFilesContentFile
-
The WorkersScriptFilesContent.contentFile choice: sets
content_file. - WorkersScriptIssues
-
Typed helper for the
observability.issuesblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptLimits
-
Typed helper for the
limitsblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptLogs
-
Typed helper for the
observability.logsblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptMigrations
-
Typed helper for the
migrationsblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptObservability
-
Typed helper for the
observabilityblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptOutbound
-
Typed helper for the
bindings.outboundblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptPackageDependencies
-
Typed helper for the
package_dependenciesblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptPlacement
-
Typed helper for the
placementblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptRenamedClasses
-
Typed helper for the
migrations.renamed_classesblock ofcloudflare_workers_script(derived from provider schema). Shared by every block of this shape in the resource. - WorkersScriptSimple
-
Typed helper for the
bindings.simpleblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptSource
-
At most one of
directory,jwton theassetsblock ofcloudflare_workers_script: the provider rejects more than one, so each variant sets one of them and a null choice sets none. - WorkersScriptSourceDirectory
-
The WorkersScriptSource.directory choice: sets
directory. - WorkersScriptSourceJwt
-
The WorkersScriptSource.jwt choice: sets
jwt. - WorkersScriptSteps
-
Typed helper for the
migrations.stepsblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptTailConsumers
-
Typed helper for the
tail_consumersblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptTraces
-
Typed helper for the
observability.tracesblock ofcloudflare_workers_script(derived from provider schema). - WorkersScriptTransferredClasses
-
Typed helper for the
migrations.transferred_classesblock ofcloudflare_workers_script(derived from provider schema). Shared by every block of this shape in the resource. - WorkersScriptWorker
-
Typed helper for the
bindings.outbound.workerblock ofcloudflare_workers_script(derived from provider schema). - WorkerSubdomain
-
Typed helper for the
subdomainblock ofcloudflare_worker(derived from provider schema). - WorkerTailConsumers
-
Typed helper for the
tail_consumersblock ofcloudflare_worker(derived from provider schema). Shared by every block of this shape in the resource. - WorkerTarget
-
Typed helper for the
previews_base_config.placement.targetblock ofcloudflare_worker(derived from provider schema). - WorkerTraces
-
Typed helper for the
observability.tracesblock ofcloudflare_worker(derived from provider schema). Shared by every block of this shape in the resource. - WorkerVersionAnnotations
-
Typed helper for the
annotationsblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionAssets
-
Typed helper for the
assetsblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionAssetsSource
-
At most one of
directory,jwton theassetsblock ofcloudflare_worker_version: the provider rejects more than one, so each variant sets one of them and a null choice sets none. - WorkerVersionAssetsSourceDirectory
-
The WorkerVersionAssetsSource.directory choice: sets
directory. - WorkerVersionAssetsSourceJwt
-
The WorkerVersionAssetsSource.jwt choice: sets
jwt. - WorkerVersionBindings
-
Typed helper for the
bindingsblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionCache
-
Typed helper for the
exports.cacheblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionCacheOptions
-
Typed helper for the
cache_optionsblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionConfig
-
Typed helper for the
assets.configblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionContainers
-
Typed helper for the
containersblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionContent
-
Exactly one of
content_base64,content_fileon themodulesblock ofcloudflare_worker_version: the provider rejects none and more than one, so each variant sets one of them. - WorkerVersionContentBase64
-
The WorkerVersionContent.contentBase64 choice: sets
content_base64. - WorkerVersionContentFile
-
The WorkerVersionContent.contentFile choice: sets
content_file. - WorkerVersionExports
-
Typed helper for the
exportsblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionLimits
-
Typed helper for the
limitsblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionMigrations
-
Typed helper for the
migrationsblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionModules
-
Typed helper for the
modulesblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionOutbound
-
Typed helper for the
bindings.outboundblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionPackageDependencies
-
Typed helper for the
package_dependenciesblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionParams
-
Typed helper for the
bindings.outbound.paramsblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionPlacement
-
Typed helper for the
placementblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionRenamedClasses
-
Typed helper for the
migrations.renamed_classesblock ofcloudflare_worker_version(derived from provider schema). Shared by every block of this shape in the resource. - WorkerVersionSimple
-
Typed helper for the
bindings.simpleblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionSteps
-
Typed helper for the
migrations.stepsblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionTarget
-
Typed helper for the
placement.targetblock ofcloudflare_worker_version(derived from provider schema). - WorkerVersionTransferredClasses
-
Typed helper for the
migrations.transferred_classesblock ofcloudflare_worker_version(derived from provider schema). Shared by every block of this shape in the resource. - WorkerVersionWorker
-
Typed helper for the
bindings.outbound.workerblock ofcloudflare_worker_version(derived from provider schema).
Enums
- ResourceKind
-
Whether a Stack entry is a
resourceblock or adatablock in Terraform JSON.
Extension Types
- DataWorkerOrder
-
order— derived from the provider schema description. - DataWorkerOrderBy
-
order_by— derived from the provider schema description. - DataWorkersKvNamespaceDirection
-
direction— derived from the provider schema description. - DataWorkersKvNamespaceOrder
-
order— derived from the provider schema description. - OutputEnvironment
-
The environment
Stack.outputEnvironmentreturns: each variable and its value, in registration order. - RefTo
-
A reference to a resource of type
R, for an argument that names another resource (network,vpc_id,role_arn, ...). - WorkerMode
-
mode— derived from the provider schema description. - WorkerPropagationPolicy
-
propagation_policy— derived from the provider schema description. - WorkersDeploymentStrategy
-
Workers Deployment enum for
strategy. - WorkersKvNamespaceJurisdiction
-
Workers Kv Namespace enum for
jurisdiction. - WorkersScriptContentType
-
Workers Script Content enum for
content_type. - WorkersScriptFormat
-
format— derived from the provider schema description. - WorkersScriptHtmlHandling
-
html_handling— derived from the provider schema description. - WorkersScriptJurisdiction
-
jurisdiction— derived from the provider schema description. - WorkersScriptMode
-
mode— derived from the provider schema description. - WorkersScriptNotFoundHandling
-
not_found_handling— derived from the provider schema description. - WorkersScriptPropagationPolicy
-
propagation_policy— derived from the provider schema description. - WorkersScriptType
-
type— derived from the provider schema description. - WorkersScriptUsageModel
-
Workers Script Usage enum for
usage_model. - WorkersScriptUsages
-
usages— derived from the provider schema description. - WorkerVersionBindingsType
-
type— derived from the provider schema description. - WorkerVersionExportsType
-
type— derived from the provider schema description. - WorkerVersionFormat
-
format— derived from the provider schema description. - WorkerVersionHtmlHandling
-
html_handling— derived from the provider schema description. - WorkerVersionIdentity
-
identity— derived from the provider schema description. - WorkerVersionInclude
-
Worker Version enum for
include. - WorkerVersionJurisdiction
-
jurisdiction— derived from the provider schema description. - WorkerVersionMode
-
mode— derived from the provider schema description. - WorkerVersionNotFoundHandling
-
not_found_handling— derived from the provider schema description. - WorkerVersionState
-
state— derived from the provider schema description. - WorkerVersionStorage
-
storage— derived from the provider schema description. - WorkerVersionUsageModel
-
Worker Version Usage enum for
usage_model.
Extensions
-
RefToList
on TfArg<
List< RefTo< >R> > -
A list-valued reference argument (
security_group_ids,subnet_ids): a literal list of RefTos, or one value that is the whole list (TfArg.variable('subnet_ids'),TfArg.expression(...)). - TerraformDurationExt on Duration
- Converts a Dart Duration into a Terraform duration string ("604800s").
Constants
- terradartManifestVariable → const String
-
The environment variable the
terradartcommand sets to the file runStack and runEnvironments describe what they wrote in.
Functions
-
runEnvironments<
E extends Enum> (List< String> args, List<E> environments, Stack build(E env), {String dir(E env)?, String? workspace(E env)?, List<String> backendConfig(E env)?, E? defaultEnv}) → Future<void> -
The entry point of a project with one Stack per environment. The
environments are the members of an enum of the project's own — any
names, each carrying its values — so the Stack takes a typed
envand derives everything per environment from it, its backend included: -
runStack(
List< String> args, Stack build(), {String out = 'tf-out'}) → Future<void> -
The entry point of a project with one Stack: writes it to
out.
Exceptions / Errors
- DuplicateModuleError
-
A
ModuleCallregistered twice under one name. - DuplicateResourceError
-
Thrown by
Stack.addwhen an entry with the same(kind, terraformType, localName)triple is registered twice. - SynthException
-
Thrown by
Stack.synth()andStack.writeTo()when the Stack has one or more SynthIssues. Nothing is written.