terradart_google 0.4.0-dev
terradart_google: ^0.4.0-dev copied to clipboard
terradart curated GCP factory wrappers — 28 google_* resources + 1 data source (compute, BigQuery, KMS, Cloud Storage, DNS, Cloud Run v2, Logging, Monitoring, Pub/Sub, Cloud Tasks, Secret Manager, Clo [...]
terradart_google #
Curated GCP factory wrappers for terradart. 28 resources + 1 data source, each shipping with typed Dart enums for fixed-value-set fields, typed helper classes for every nested block, and golden-tested deterministic codegen.
Resources #
Compute (5) #
GoogleComputeNetwork,GoogleComputeAddress,GoogleComputeSubnetwork,GoogleComputeFirewall,GoogleComputeInstance(typedBootDisk,NetworkInterface,Scheduling,ShieldedInstanceConfig,ConfidentialInstanceConfig, etc.).
BigQuery (2) #
GoogleBigqueryDataset(8-variant sealedAccesshierarchy covering UserByEmail / GroupByEmail / SpecialGroup / Domain / IamMember / View / Dataset / Routine).GoogleBigqueryTable(typedTimePartitioning,RangePartitioning,MaterializedView,ExternalDataConfiguration+ per-format sub-helpers,TableConstraints).
Cloud KMS (2) #
GoogleKmsKeyRing,GoogleKmsCryptoKey(typedKmsKeyPurpose,KmsProtectionLevel,VersionTemplate).
Cloud Storage (2) #
GoogleStorageBucket(typedBucketStorageClass,LifecycleRule,LifecycleAction,LifecycleCondition,Versioning,RetentionPolicy,Autoclass,Encryption,SoftDeletePolicy,IpFilter, etc.).GoogleStorageBucketObject(sealedBucketObjectContentfor source / content exactly-one-of; typedBucketObjectStorageClass,CustomerEncryption,BucketObjectRetention).
Cloud DNS (1) #
GoogleDnsManagedZone(typedDnsZoneVisibility,DnssecState,DnssecKeyAlgorithm,DnssecKeyType,ForwardingPath; helpers for private visibility / DNSSEC / peering / forwarding / cloud logging configs).
Cloud Run v2 (1) #
GoogleCloudRunV2Service(sealedEnvVarSourcefor env literal vs.secret_key_ref; sealedVolumeSourcefor the 5 volume sources; typedIngress,LaunchStage,ExecutionEnvironment,ScalingMode,Template,ServiceContainer,ContainerResources,ContainerPort,VolumeMount,StartupProbe,LivenessProbe).
Cloud Logging (1) #
GoogleLoggingProjectSink(typedBigqueryOptions,LogSinkExclusion).
Cloud Monitoring (1) #
GoogleMonitoringAlertPolicy(typedComparison,Aligner19 variants,Reducer14 variants,EvaluationMissingData,AlertSeverity,AlertCombiner;AlertConditioncovering the 6 mutually-exclusive condition variants;AlertStrategy,NotificationRateLimit,Documentation).
Pub/Sub (4) #
GooglePubsubTopic,GooglePubsubSubscription(typedPushConfig,BigQueryConfig,CloudStorageConfig,DeadLetterPolicy,RetryPolicy,ExpirationPolicy,OidcToken,NoWrapper).GooglePubsubTopicIamMember,GooglePubsubSubscriptionIamMember.
Cloud Tasks (2) #
GoogleCloudTasksQueue(typedRateLimits,RetryConfig,QueueHttpTarget,StackdriverLoggingConfig,AppEngineRoutingOverride).GoogleCloudTasksQueueIamMember.
Secret Manager (3) #
GoogleSecretManagerSecret(sealedReplicationfor auto / userManaged variants).GoogleSecretManagerSecretVersion(write-onlysecret_data_wo).GoogleSecretManagerSecretIamMember.
Cloud Scheduler (1) #
GoogleCloudSchedulerJob(Pub/Sub / HTTP / AppEngine targets).
IAM (1) #
GoogleServiceAccount(pre-formattedmemberref for IAM bindings).
Project enablement (1) #
GoogleProjectService.
Data sources (1) #
GoogleProject(project number lookup).
How resources are built #
The factory wrappers under lib/src/<service>/ are emitted by terradart wrap from curated overrides under terradart_codegen. Their schema carriers ($Foo abstracts + <resource>Sensitive constants under lib/src/generated/) are generated by terradart_codegen + schemantic from the provider schema and committed to the package, so consumers do not need to run build_runner themselves.
CI verifies determinism via terradart wrap --check: all 56 emitted files (28 resource Layer 2 + 28 resource Layer 1) must stay byte-identical across PRs.
For any other google_* / google-beta_* resource that isn't in the catalog above, run terradart codegen against your provider schema dump and emit bindings into your own lib/generated/ rather than depending on this package.
For the runtime side (Stack, Resource<S>, StackSynth.synth), see terradart_core. For project-level documentation, see the terradart repo README.
Installation #
dependencies:
terradart_core: ^0.1.0-dev
terradart_google: ^0.1.0-dev
terradart is a SemVer pre-release; explicit ^0.1.0-dev constraints are required because dart pub get skips pre-releases by default.
Usage example #
import 'package:terradart_core/terradart_core.dart';
import 'package:terradart_google/provider.dart';
import 'package:terradart_google/storage.dart';
class AssetsStack extends Stack {
AssetsStack({required String projectId})
: super(providers: [
GoogleProvider(project: projectId, region: 'asia-northeast1'),
]) {
add(
GoogleStorageBucket(
localName: 'assets',
name: TfArg.literal('my-app-assets-prod'),
location: TfArg.literal('ASIA-NORTHEAST1'),
storageClass: TfArg.literal(BucketStorageClass.standard), // typed enum
versioning: const Versioning(enabled: true), // typed helper
lifecycleRule: const [
LifecycleRule(
action: LifecycleAction(
type: LifecycleActionType.setStorageClass,
storageClass: BucketStorageClass.archive,
),
condition: LifecycleCondition(age: 365),
),
],
),
);
}
}
See the 14 runnable quickstart projects under examples/ for end-to-end usage of every service.