terradart_cloudflare 0.35.0
terradart_cloudflare: ^0.35.0 copied to clipboard
Curated factory wrappers for Cloudflare resources (official cloudflare/cloudflare Terraform provider) for Dart-first Terraform stacks.
terradart_cloudflare #
Curated factory wrappers for Cloudflare resources (the official cloudflare/cloudflare Terraform provider) for Dart-first Terraform stacks.
Cloudflare's positioning in a Dart stack is the infrastructure edge around your app — DNS zones and records that point custom domains toward Cloud Run, Firebase Hosting, or wherever your Dart backend lives. (This package does not deploy Dart on Workers; it declares the Cloudflare edge infrastructure your Dart app sits behind.)
The catalog at the current provider pin is filled (every cloudflare_* resource and data source). Nested plugin-framework objects are typed Dart helper classes, not TfArg<Map<String, dynamic>>. A later pin that adds names lands on request — open a feature request.
Security & Credentials #
Secrets never appear in synth output by design. CloudflareProvider has no api_token / api_key / api_user_service_key parameters (sensitive attributes are structurally excluded); authenticate at apply time via CLOUDFLARE_API_TOKEN (recommended) or other standard CLOUDFLARE_* environment variables.
Installation #
dependencies:
terradart_core: ^0.35.0
terradart_cloudflare: ^0.35.0
Usage example #
// lib/edge_dns_stack.dart
import 'package:terradart_cloudflare/provider.dart';
import 'package:terradart_cloudflare/zone.dart';
import 'package:terradart_cloudflare/dns.dart';
final class EdgeDnsStack extends Stack {
EdgeDnsStack()
: super(providers: [const CloudflareProvider()]) {
final zone = CloudflareZone(
'main',
name: .literal('example.com'),
account: ZoneAccount(id: .literal('your-account-id')),
);
add(zone);
add(
CloudflareDnsRecord(
'api',
zoneId: zone.ref,
name: .literal('api.example.com'),
type: .cname,
ttl: .literal(1),
content: .content(.literal('ghs.googlehosted.com')),
proxied: .literal(true),
),
);
}
}
// bin/infra.dart
import 'package:my_app/edge_dns_stack.dart';
Future<void> main() async {
final stack = EdgeDnsStack();
await stack.writeTo('tf-out');
}
dart pub get
dart pub global activate terradart_cli
CLOUDFLARE_API_TOKEN=... terradart apply
Curated surface #
Curated surface is the full cloudflare/cloudflare catalog at the pin — every resource and data source — across per-service barrels (zone, dns, r2, zero_trust, workers, …). The provider is pinned exactly (kCloudflareProviderVersionConstraint, the release the wrappers were generated from). Start with examples/cloudflare_dns_quickstart; the rest of the catalog is exercised by examples/cloudflare_leftover_quickstart (synth only; CI validates it against the provider).
Generated by the maintainer pipeline (terradart-codegen wrap against the pin fixture); do not hand-edit files under lib/src/.