terradart_google 0.9.0
terradart_google: ^0.9.0 copied to clipboard
terradart curated GCP factory wrappers — 118 google_* resources + 1 data source (Compute + LB stack, Cloud Build, Artifact Registry, Eventarc, BigQuery + Data ops, KMS, Cloud Storage + notifications, [...]
example/main.dart
import 'dart:convert' as convert;
import 'package:terradart_core/terradart_core.dart';
import 'package:terradart_google/terradart_google.dart';
/// Minimal example: a single Pub/Sub topic, synthesized to Terraform JSON.
class HelloStack extends Stack {
HelloStack({required String projectId})
: super(
providers: [
GoogleProvider(project: projectId, region: 'us-central1')
],
) {
add(GooglePubsubTopic(localName: 'hello', name: TfArg.literal('hello')));
}
@override
Future<void> synth({required String outDir}) async {
final result = StackSynth.synth(this);
print(const convert.JsonEncoder.withIndent(' ').convert(result.tfJson));
}
}
void main() async {
await HelloStack(projectId: 'YOUR-PROJECT-ID').synth(outDir: '.');
}