GoogleBigqueryDataTransferConfig class final

Factory wrapper for google_bigquery_data_transfer_config (provider hashicorp/google ~> 7.0).

Manages a BigQuery Data Transfer Service (DTS) configuration — a recurring import job that lands data into a BigQuery dataset from a Google-owned source (scheduled_query, google_cloud_storage, dcm_dt, google_ads, youtube_channel, ...) or a third-party connector (amazon_s3, redshift, azure_blob_storage, ...). The canonical reference for data_source_id values and the per-source params map is the DTS data-source catalog.

Required identity:

  • localName: Terraform local name (the address segment after google_bigquery_data_transfer_config.).
  • displayName: human-readable label shown in the BigQuery UI.
  • dataSourceId: the DTS data-source registry key. Free-form String rather than a Dart enum because Google adds new connectors asynchronously and we do not want to pin a terradart release to the registry. Common values: "scheduled_query", "google_cloud_storage", "amazon_s3", "redshift", "google_ads", "youtube_channel", "dcm_dt".
  • params: data-source-specific key/value bag. The expected keys depend on dataSourceId; see the doc table below for the three most common shapes.

params per data_source_id (canonical entries — consult the DTS documentation for the complete schema of each source):

scheduled_query — re-runs a SQL query and writes the result to a destination table:

params: TfArg.literal(const {
  'query':
      'SELECT date, COUNT(*) AS n FROM `proj.ds.events` '
      'WHERE date = @run_date GROUP BY date',
  'destination_table_name_template': 'daily_event_counts_{run_date}',
  'write_disposition': 'WRITE_APPEND',       // or WRITE_TRUNCATE
  'partitioning_field': '',                  // optional
}),

google_cloud_storage — loads CSV / JSON / Avro / Parquet files from a GCS prefix into a destination table:

params: TfArg.literal(const {
  'data_path_template': 'gs://my-bucket/exports/{run_date}/*.csv',
  'destination_table_name_template': 'gcs_import_{run_date}',
  'file_format': 'CSV',                      // CSV|JSON|AVRO|PARQUET|ORC
  'field_delimiter': ',',
  'skip_leading_rows': '1',
  'write_disposition': 'WRITE_APPEND',
}),

amazon_s3 — pulls files from an S3 prefix. The plaintext key id goes in params, the secret key goes in sensitiveParams (the provider rejects configurations that put the secret in params):

params: TfArg.literal(const {
  'data_path': 's3://my-bucket/exports/{run_date}/*.csv',
  'destination_table_name_template': 's3_import_{run_date}',
  'access_key_id': 'AKIAIOSFODNN7EXAMPLE',
  'file_format': 'CSV',
}),
sensitiveParams: BigqueryDataTransferConfigSensitiveParams(
  secretAccessKey: TfArg.ref(awsSecret.versionRef),
),

Schedule shapes for schedule (App Engine cron syntax — the only format DTS accepts):

  • "every 24 hours" / "every 6 hours" (fixed interval)
  • "every day 03:00" (UTC, daily anchor)
  • "first sunday of month 00:00" (calendar anchor)
  • "1st,3rd monday of month 15:30" (multi-anchor)
  • "" (empty) — fall back to the data source's default cadence.

Manual-only mode: set scheduleOptions .disableAutoScheduling = TfArg.literal(true) to suppress the cron entirely; runs must then be triggered via transferConfigs.startManualRuns.

Credentials handling: the S3 secret access key MUST be placed in sensitiveParams rather than params. The plaintext slot (sensitiveParams.secretAccessKey) is schema-flagged sensitive and also enumerated in extraSensitiveFields (belt-and-suspenders); the write-only-API siblings (secretAccessKeyWo + secretAccessKeyWoVersion) keep the plaintext out of Terraform state entirely on Terraform 1.11+ — prefer them when your CLI version supports it, bumping secretAccessKeyWoVersion to force a rotation.

Example (daily GCS → BigQuery import):

final dailyImport = GoogleBigqueryDataTransferConfig(
  localName: 'daily_gcs_import',
  displayName: TfArg.literal('Daily GCS export -> BigQuery'),
  dataSourceId: TfArg.literal('google_cloud_storage'),
  destinationDatasetId: TfArg.ref(analytics.datasetIdRef),
  location: TfArg.literal('US'),
  schedule: TfArg.literal('every day 03:00'),
  params: TfArg.literal(const {
    'data_path_template':
        'gs://exports-bucket/daily/{run_date}/*.csv',
    'destination_table_name_template': 'gcs_import_{run_date}',
    'file_format': 'CSV',
    'field_delimiter': ',',
    'skip_leading_rows': '1',
  }),
  emailPreferences: BigqueryDataTransferConfigEmailPreferences(
    enableFailureEmail: TfArg.literal(true),
  ),
);

Composition pattern: extends Resource<$GoogleBigqueryDataTransferConfig> for runtime behavior. The nested helpers (BigqueryDataTransferConfigScheduleOptions, BigqueryDataTransferConfigEmailPreferences, BigqueryDataTransferConfigSensitiveParams, BigqueryDataTransferConfigEncryptionConfiguration) are modeled in the prelude below.

Constructors

GoogleBigqueryDataTransferConfig({required String localName, required TfArg<String> displayName, required TfArg<String> dataSourceId, TfArg<String>? destinationDatasetId, TfArg<String>? location, required TfArg<Map<String, String>> params, TfArg<String>? schedule, BigqueryDataTransferConfigScheduleOptions? scheduleOptions, TfArg<bool>? disabled, TfArg<String>? serviceAccountName, TfArg<String>? notificationPubsubTopic, BigqueryDataTransferConfigEmailPreferences? emailPreferences, BigqueryDataTransferConfigSensitiveParams? sensitiveParams, BigqueryDataTransferConfigEncryptionConfiguration? encryptionConfiguration, TfArg<num>? dataRefreshWindowDays, TfArg<String>? project, LifecycleOptions? lifecycle, List<DependencyTarget>? dependsOn})

Properties

$sensitiveFields Set<String>
Field names that are @Sensitive per the IR-derived per-resource constant. Curated factories override with a baked-in static const Set<String> (file-private in v0.5+).
no setter
$supportsDeletionProtection bool
Capability flag: true when this resource's underlying Terraform schema has a deletion_protection boolean attribute that the synth-time devMode flow can flip to false. Defaults to false; the codegen emitter overrides this to true for wrappers whose schema includes the attribute.
no setterinherited
argMap Map<String, TfArg?>
Argument-name → TfArg map. Keys are snake_case (Terraform JSON name). Synth emits these keys directly; the factory is responsible for the camelCase → snake_case translation at construction time.
finalinherited
dependsOn List<DependencyTarget>?
Optional depends_on = [...]. Each entry is a DependencyTarget — either a wholesale resource (rendered as bare address) or an explicit TfRef (rendered via bareAddress).
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id → TfRef<String>
Reference to id attribute (the transfer config's full resource name, projects/{project}/locations/{location}/transferConfigs/{configId} or projects/{project}/transferConfigs/{configId} for global configs). Downstream consumers (e.g. monitoring policies that alert on transfer-run failures) consume this value.
no setter
kind → ResourceKind
Always ResourceKind.resource. Overridden by Data.
no setterinherited
lifecycle → LifecycleOptions?
Optional lifecycle { ... } block.
finalinherited
localName String
User-supplied local name within a Stack.
finalinherited
nameRef → TfRef<String>
Reference to the computed name attribute. Identical in shape to id; the provider populates both with the same full resource name on create.
no setter
provider → ProviderBinding?
Optional explicit provider binding. Only the type is referenced here; the concrete Provider class lives in terradart_google (provider classes are defined per-provider, outside the core runtime).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
terraformType String
Terraform resource type, e.g. google_pubsub_topic.
finalinherited
tfAddress String
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.
inherited

Operators

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

Constants

$tfType → const String