UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

489 lines (488 loc) • 21.7 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Represents a data transfer configuration. A transfer configuration * contains all metadata needed to perform a data transfer. * * To get more information about Config, see: * * * [API documentation](https://cloud.google.com/bigquery/docs/reference/datatransfer/rest/v1/projects.locations.transferConfigs/create) * * How-to Guides * * [Official Documentation](https://cloud.google.com/bigquery/docs/reference/datatransfer/rest/) * * > **Note:** All arguments marked as write-only values will not be stored in the state: `sensitive_params.secret_access_key_wo`. * Read more about Write-only Attributes. * * ## Example Usage * * ### Bigquerydatatransfer Config Scheduled Query * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const permissions = new gcp.projects.IAMMember("permissions", { * project: project.then(project => project.projectId), * role: "roles/iam.serviceAccountTokenCreator", * member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-bigquerydatatransfer.iam.gserviceaccount.com`), * }); * const myDataset = new gcp.bigquery.Dataset("my_dataset", { * datasetId: "my_dataset", * friendlyName: "foo", * description: "bar", * location: "asia-northeast1", * }, { * dependsOn: [permissions], * }); * const queryConfig = new gcp.bigquery.DataTransferConfig("query_config", { * displayName: "my-query", * location: "asia-northeast1", * dataSourceId: "scheduled_query", * schedule: "first sunday of quarter 00:00", * destinationDatasetId: myDataset.datasetId, * params: { * destination_table_name_template: "my_table", * write_disposition: "WRITE_APPEND", * query: "SELECT name FROM tabl WHERE x = 'y'", * }, * }, { * dependsOn: [permissions], * }); * ``` * ### Bigquerydatatransfer Config Cmek * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const permissions = new gcp.projects.IAMMember("permissions", { * project: project.then(project => project.projectId), * role: "roles/iam.serviceAccountTokenCreator", * member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-bigquerydatatransfer.iam.gserviceaccount.com`), * }); * const myDataset = new gcp.bigquery.Dataset("my_dataset", { * datasetId: "example_dataset", * friendlyName: "foo", * description: "bar", * location: "asia-northeast1", * }, { * dependsOn: [permissions], * }); * const keyRing = new gcp.kms.KeyRing("key_ring", { * name: "example-keyring", * location: "us", * }); * const cryptoKey = new gcp.kms.CryptoKey("crypto_key", { * name: "example-key", * keyRing: keyRing.id, * }); * const queryConfigCmek = new gcp.bigquery.DataTransferConfig("query_config_cmek", { * displayName: "display-name", * location: "asia-northeast1", * dataSourceId: "scheduled_query", * schedule: "first sunday of quarter 00:00", * destinationDatasetId: myDataset.datasetId, * params: { * destination_table_name_template: "my_table", * write_disposition: "WRITE_APPEND", * query: "SELECT name FROM tabl WHERE x = 'y'", * }, * encryptionConfiguration: { * kmsKeyName: cryptoKey.id, * }, * }, { * dependsOn: [permissions], * }); * ``` * ### Bigquerydatatransfer Config Salesforce * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const myDataset = new gcp.bigquery.Dataset("my_dataset", { * datasetId: "my_dataset", * description: "My dataset", * location: "asia-northeast1", * }); * const salesforceConfig = new gcp.bigquery.DataTransferConfig("salesforce_config", { * displayName: "my-salesforce-config", * location: "asia-northeast1", * dataSourceId: "salesforce", * schedule: "first sunday of quarter 00:00", * destinationDatasetId: myDataset.datasetId, * params: { * "connector.authentication.oauth.clientId": "client-id", * "connector.authentication.oauth.clientSecret": "client-secret", * "connector.authentication.oauth.myDomain": "MyDomainName", * assets: "[\"asset-a\",\"asset-b\"]", * }, * }); * ``` * * ## Ephemeral Attributes Reference * * The following write-only attributes are supported: * * <a name="nestedSensitiveParams"></a>The `sensitiveParams` block supports: * * * `secretAccessKeyWo` - * (Optional) * The Secret Access Key of the AWS account transferring data from. * **Note**: This property is write-only and will not be read from the API. * * ## Import * * Config can be imported using any of these accepted formats: * * * `{{project}}/{{name}}` * * * `{{project}} {{name}}` * * * `{{name}}` * * When using the `pulumi import` command, Config can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:bigquery/dataTransferConfig:DataTransferConfig default {{project}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:bigquery/dataTransferConfig:DataTransferConfig default "{{project}} {{name}}" * ``` * * ```sh * $ pulumi import gcp:bigquery/dataTransferConfig:DataTransferConfig default {{name}} * ``` */ export declare class DataTransferConfig extends pulumi.CustomResource { /** * Get an existing DataTransferConfig resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DataTransferConfigState, opts?: pulumi.CustomResourceOptions): DataTransferConfig; /** * Returns true if the given object is an instance of DataTransferConfig. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is DataTransferConfig; /** * 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. */ readonly dataRefreshWindowDays: pulumi.Output<number | undefined>; /** * The data source id. Cannot be changed once the transfer config is created. */ readonly dataSourceId: pulumi.Output<string>; /** * The BigQuery target dataset id. */ readonly destinationDatasetId: pulumi.Output<string | undefined>; /** * When set to true, no runs are scheduled for a given transfer. */ readonly disabled: pulumi.Output<boolean | undefined>; /** * The user specified display name for the transfer config. */ readonly displayName: pulumi.Output<string>; /** * 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. */ readonly emailPreferences: pulumi.Output<outputs.bigquery.DataTransferConfigEmailPreferences | undefined>; /** * Represents the encryption configuration for a transfer. * Structure is documented below. */ readonly encryptionConfiguration: pulumi.Output<outputs.bigquery.DataTransferConfigEncryptionConfiguration | undefined>; /** * The geographic location where the transfer config should reside. * Examples: US, EU, asia-northeast1. The default value is US. */ readonly location: pulumi.Output<string | undefined>; /** * The resource name of the transfer config. Transfer config names have the * form projects/{projectId}/locations/{location}/transferConfigs/{configId} * or projects/{projectId}/transferConfigs/{configId}, * where configId is usually a uuid, but this is not required. * The name is ignored when creating a transfer config. */ readonly name: pulumi.Output<string>; /** * Pub/Sub topic where notifications will be sent after transfer runs * associated with this transfer config finish. */ readonly notificationPubsubTopic: pulumi.Output<string | undefined>; /** * 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. */ readonly params: pulumi.Output<{ [key: string]: string; }>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * 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 minimum interval time between recurring transfers depends * on the data source; refer to the documentation for your data source. */ readonly schedule: pulumi.Output<string | undefined>; /** * Options customizing the data transfer schedule. * Structure is documented below. */ readonly scheduleOptions: pulumi.Output<outputs.bigquery.DataTransferConfigScheduleOptions | undefined>; /** * 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. */ readonly sensitiveParams: pulumi.Output<outputs.bigquery.DataTransferConfigSensitiveParams | undefined>; /** * 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. */ readonly serviceAccountName: pulumi.Output<string | undefined>; /** * Create a DataTransferConfig resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DataTransferConfigArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DataTransferConfig resources. */ export interface DataTransferConfigState { /** * 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. */ dataRefreshWindowDays?: pulumi.Input<number>; /** * The data source id. Cannot be changed once the transfer config is created. */ dataSourceId?: pulumi.Input<string>; /** * The BigQuery target dataset id. */ destinationDatasetId?: pulumi.Input<string>; /** * When set to true, no runs are scheduled for a given transfer. */ disabled?: pulumi.Input<boolean>; /** * The user specified display name for the transfer config. */ displayName?: pulumi.Input<string>; /** * 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. */ emailPreferences?: pulumi.Input<inputs.bigquery.DataTransferConfigEmailPreferences>; /** * Represents the encryption configuration for a transfer. * Structure is documented below. */ encryptionConfiguration?: pulumi.Input<inputs.bigquery.DataTransferConfigEncryptionConfiguration>; /** * The geographic location where the transfer config should reside. * Examples: US, EU, asia-northeast1. The default value is US. */ location?: pulumi.Input<string>; /** * The resource name of the transfer config. Transfer config names have the * form projects/{projectId}/locations/{location}/transferConfigs/{configId} * or projects/{projectId}/transferConfigs/{configId}, * where configId is usually a uuid, but this is not required. * The name is ignored when creating a transfer config. */ name?: pulumi.Input<string>; /** * Pub/Sub topic where notifications will be sent after transfer runs * associated with this transfer config finish. */ notificationPubsubTopic?: pulumi.Input<string>; /** * 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. */ params?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * 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 minimum interval time between recurring transfers depends * on the data source; refer to the documentation for your data source. */ schedule?: pulumi.Input<string>; /** * Options customizing the data transfer schedule. * Structure is documented below. */ scheduleOptions?: pulumi.Input<inputs.bigquery.DataTransferConfigScheduleOptions>; /** * 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. */ sensitiveParams?: pulumi.Input<inputs.bigquery.DataTransferConfigSensitiveParams>; /** * 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. */ serviceAccountName?: pulumi.Input<string>; } /** * The set of arguments for constructing a DataTransferConfig resource. */ export interface DataTransferConfigArgs { /** * 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. */ dataRefreshWindowDays?: pulumi.Input<number>; /** * The data source id. Cannot be changed once the transfer config is created. */ dataSourceId: pulumi.Input<string>; /** * The BigQuery target dataset id. */ destinationDatasetId?: pulumi.Input<string>; /** * When set to true, no runs are scheduled for a given transfer. */ disabled?: pulumi.Input<boolean>; /** * The user specified display name for the transfer config. */ displayName: pulumi.Input<string>; /** * 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. */ emailPreferences?: pulumi.Input<inputs.bigquery.DataTransferConfigEmailPreferences>; /** * Represents the encryption configuration for a transfer. * Structure is documented below. */ encryptionConfiguration?: pulumi.Input<inputs.bigquery.DataTransferConfigEncryptionConfiguration>; /** * The geographic location where the transfer config should reside. * Examples: US, EU, asia-northeast1. The default value is US. */ location?: pulumi.Input<string>; /** * Pub/Sub topic where notifications will be sent after transfer runs * associated with this transfer config finish. */ notificationPubsubTopic?: pulumi.Input<string>; /** * 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. */ params: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * 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 minimum interval time between recurring transfers depends * on the data source; refer to the documentation for your data source. */ schedule?: pulumi.Input<string>; /** * Options customizing the data transfer schedule. * Structure is documented below. */ scheduleOptions?: pulumi.Input<inputs.bigquery.DataTransferConfigScheduleOptions>; /** * 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. */ sensitiveParams?: pulumi.Input<inputs.bigquery.DataTransferConfigSensitiveParams>; /** * 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. */ serviceAccountName?: pulumi.Input<string>; }