DataTransferConfigArgs

data class DataTransferConfigArgs(val dataRefreshWindowDays: Output<Int>? = null, val dataSourceId: Output<String>? = null, val destinationDatasetId: Output<String>? = null, val disabled: Output<Boolean>? = null, val displayName: Output<String>? = null, val emailPreferences: Output<DataTransferConfigEmailPreferencesArgs>? = null, val location: Output<String>? = null, val notificationPubsubTopic: Output<String>? = null, val params: Output<Map<String, String>>? = null, val project: Output<String>? = null, val schedule: Output<String>? = null, val scheduleOptions: Output<DataTransferConfigScheduleOptionsArgs>? = null, val sensitiveParams: Output<DataTransferConfigSensitiveParamsArgs>? = null, val serviceAccountName: Output<String>? = null) : ConvertibleToJava<DataTransferConfigArgs>

Represents a data transfer configuration. A transfer configuration contains all metadata needed to perform a data transfer. To get more information about Config, see:

Warning: All arguments including the following potentially sensitive values will be stored in the raw state as plain text: sensitive_params.secret_access_key. Read more about sensitive data in state.

Example Usage

Bigquerydatatransfer Config Scheduled Query

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.projects.IAMMember;
import com.pulumi.gcp.projects.IAMMemberArgs;
import com.pulumi.gcp.bigquery.Dataset;
import com.pulumi.gcp.bigquery.DatasetArgs;
import com.pulumi.gcp.bigquery.DataTransferConfig;
import com.pulumi.gcp.bigquery.DataTransferConfigArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var project = OrganizationsFunctions.getProject();
var permissions = new IAMMember("permissions", IAMMemberArgs.builder()
.project(project.applyValue(getProjectResult -> getProjectResult.projectId()))
.role("roles/iam.serviceAccountTokenCreator")
.member(String.format("serviceAccount:service-%s@gcp-sa-bigquerydatatransfer.iam.gserviceaccount.com", project.applyValue(getProjectResult -> getProjectResult.number())))
.build());
var myDataset = new Dataset("myDataset", DatasetArgs.builder()
.datasetId("my_dataset")
.friendlyName("foo")
.description("bar")
.location("asia-northeast1")
.build(), CustomResourceOptions.builder()
.dependsOn(permissions)
.build());
var queryConfig = new DataTransferConfig("queryConfig", DataTransferConfigArgs.builder()
.displayName("my-query")
.location("asia-northeast1")
.dataSourceId("scheduled_query")
.schedule("first sunday of quarter 00:00")
.destinationDatasetId(myDataset.datasetId())
.params(Map.ofEntries(
Map.entry("destination_table_name_template", "my_table"),
Map.entry("write_disposition", "WRITE_APPEND"),
Map.entry("query", "SELECT name FROM tabl WHERE x = 'y'")
))
.build(), CustomResourceOptions.builder()
.dependsOn(permissions)
.build());
}
}

Import

Config can be imported using any of these accepted formats:

$ pulumi import gcp:bigquery/dataTransferConfig:DataTransferConfig default {{name}}

Constructors

Link copied to clipboard
constructor(dataRefreshWindowDays: Output<Int>? = null, dataSourceId: Output<String>? = null, destinationDatasetId: Output<String>? = null, disabled: Output<Boolean>? = null, displayName: Output<String>? = null, emailPreferences: Output<DataTransferConfigEmailPreferencesArgs>? = null, location: Output<String>? = null, notificationPubsubTopic: Output<String>? = null, params: Output<Map<String, String>>? = null, project: Output<String>? = null, schedule: Output<String>? = null, scheduleOptions: Output<DataTransferConfigScheduleOptionsArgs>? = null, sensitiveParams: Output<DataTransferConfigSensitiveParamsArgs>? = null, serviceAccountName: Output<String>? = null)

Properties

Link copied to clipboard
val dataRefreshWindowDays: Output<Int>? = null

The number of days to look back to automatically refresh the data. For example, if dataRefreshWindowDays = 10, then every day BigQuery reingests data for today-10, today-1, rather than ingesting data for just today-1. Only valid if the data source supports the feature. Set the value to 0 to use the default value.

Link copied to clipboard
val dataSourceId: Output<String>? = null

The data source id. Cannot be changed once the transfer config is created.

Link copied to clipboard
val destinationDatasetId: Output<String>? = null

The BigQuery target dataset id.

Link copied to clipboard
val disabled: Output<Boolean>? = null

When set to true, no runs are scheduled for a given transfer.

Link copied to clipboard
val displayName: Output<String>? = null

The user specified display name for the transfer config.

Link copied to clipboard

Email notifications will be sent according to these preferences to the email address of the user who owns this transfer config. Structure is documented below.

Link copied to clipboard
val location: Output<String>? = null

The geographic location where the transfer config should reside. Examples: US, EU, asia-northeast1. The default value is US.

Link copied to clipboard
val notificationPubsubTopic: Output<String>? = null

Pub/Sub topic where notifications will be sent after transfer runs associated with this transfer config finish.

Link copied to clipboard
val params: Output<Map<String, String>>? = null

Parameters specific to each data source. For more information see the bq tab in the 'Setting up a data transfer' section for each data source. For example the parameters for Cloud Storage transfers are listed here: https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq NOTE : If you are attempting to update a parameter that cannot be updated (due to api limitations) please force recreation of the resource.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val schedule: Output<String>? = null

Data transfer schedule. If the data source does not support a custom schedule, this should be empty. If it is empty, the default value for the data source will be used. The specified times are in UTC. Examples of valid format: 1st,3rd monday of month 15:30, every wed,fri of jan, jun 13:15, and first sunday of quarter 00:00. See more explanation about the format here: https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format NOTE: the granularity should be at least 8 hours, or less frequent.

Link copied to clipboard

Options customizing the data transfer schedule. Structure is documented below.

Link copied to clipboard

Different parameters are configured primarily using the the params field on this resource. This block contains the parameters which contain secrets or passwords so that they can be marked sensitive and hidden from plan output. The name of the field, eg: secret_access_key, will be the key in the params map in the api request. Credentials may not be specified in both locations and will cause an error. Changing from one location to a different credential configuration in the config will require an apply to update state. Structure is documented below.

Link copied to clipboard
val serviceAccountName: Output<String>? = null

Service account email. If this field is set, transfer config will be created with this service account credentials. It requires that requesting user calling this API has permissions to act as this service account.

Functions

Link copied to clipboard
open override fun toJava(): DataTransferConfigArgs