Module bigquery
This page documents the language specification for the gcp package. If you're looking for help working with the inputs, outputs, or functions of gcp resources in a Pulumi program, please see the resource documentation for examples and API reference.
Resources
Functions
Others
- AppProfileArgs
- AppProfileState
- ConnectionArgs
- ConnectionState
- DatasetAccessArgs
- DatasetAccessState
- DatasetArgs
- DatasetState
- DataTransferConfigArgs
- DataTransferConfigState
- GetDefaultServiceAccountArgs
- GetDefaultServiceAccountResult
- JobArgs
- JobState
- ReservationArgs
- ReservationState
- TableArgs
- TableState
Resources
Resource AppProfile
class AppProfile extends CustomResourceApp profile is a configuration object describing how Cloud Bigtable should treat traffic from a particular end user application.
Example Usage - Bigtable App Profile Multicluster
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const instance = new gcp.bigtable.Instance("instance", {
cluster: [{
clusterId: "bt-instance",
zone: "us-central1-b",
numNodes: 3,
storageType: "HDD",
}],
deletionProtection: "true",
});
const ap = new gcp.bigquery.AppProfile("ap", {
instance: instance.name,
appProfileId: "bt-profile",
multiClusterRoutingUseAny: true,
ignoreWarnings: true,
});Example Usage - Bigtable App Profile Singlecluster
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const instance = new gcp.bigtable.Instance("instance", {
cluster: [{
clusterId: "bt-instance",
zone: "us-central1-b",
numNodes: 3,
storageType: "HDD",
}],
deletionProtection: "true",
});
const ap = new gcp.bigquery.AppProfile("ap", {
instance: instance.name,
appProfileId: "bt-profile",
single_cluster_routing: {
clusterId: "bt-instance",
allowTransactionalWrites: true,
},
ignoreWarnings: true,
});constructor
new AppProfile(name: string, args: AppProfileArgs, opts?: pulumi.CustomResourceOptions)Create a AppProfile resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AppProfileState, opts?: pulumi.CustomResourceOptions): AppProfileGet an existing AppProfile resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is AppProfileReturns true if the given object is an instance of AppProfile. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property appProfileId
public appProfileId: pulumi.Output<string>;The unique name of the app profile in the form [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
property description
public description: pulumi.Output<string | undefined>;Long form description of the use case for this app profile.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property ignoreWarnings
public ignoreWarnings: pulumi.Output<boolean | undefined>;If true, ignore safety checks when deleting/updating the app profile.
property instance
public instance: pulumi.Output<string | undefined>;The name of the instance to create the app profile within.
property multiClusterRoutingUseAny
public multiClusterRoutingUseAny: pulumi.Output<boolean | undefined>;If true, read/write requests are routed to the nearest cluster in the instance, and will fail over to the nearest cluster that is available in the event of transient errors or delays. Clusters in a region are considered equidistant. Choosing this option sacrifices read-your-writes consistency to improve availability.
property name
public name: pulumi.Output<string>;The unique name of the requested app profile. Values are of the form
‘projects/
property project
public project: pulumi.Output<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property singleClusterRouting
public singleClusterRouting: pulumi.Output<AppProfileSingleClusterRouting | undefined>;Use a single-cluster routing policy. Structure is documented below.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource Connection
class Connection extends CustomResourceA connection allows BigQuery connections to external data sources..
To get more information about Connection, see:
- API documentation
- How-to Guides
Warning: All arguments including
cloud_sql.credential.passwordwill be stored in the raw state as plain-text. Read more about sensitive data in state.
Example Usage - Bigquery Connection Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as random from "@pulumi/random";
const instance = new gcp.sql.DatabaseInstance("instance", {
databaseVersion: "POSTGRES_11",
region: "us-central1",
settings: {
tier: "db-f1-micro",
},
});
const db = new gcp.sql.Database("db", {instance: instance.name});
const pwd = new random.RandomPassword("pwd", {
length: 16,
special: false,
});
const user = new gcp.sql.User("user", {
instance: instance.name,
password: pwd.result,
});
const connection = new gcp.bigquery.Connection("connection", {
friendlyName: "👋",
description: "a riveting description",
cloud_sql: {
instanceId: instance.connectionName,
database: db.name,
type: "POSTGRES",
credential: {
username: user.name,
password: user.password,
},
},
});Example Usage - Bigquery Connection Full
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
import * as random from "@pulumi/random";
const instance = new gcp.sql.DatabaseInstance("instance", {
databaseVersion: "POSTGRES_11",
region: "us-central1",
settings: {
tier: "db-f1-micro",
},
});
const db = new gcp.sql.Database("db", {instance: instance.name});
const pwd = new random.RandomPassword("pwd", {
length: 16,
special: false,
});
const user = new gcp.sql.User("user", {
instance: instance.name,
password: pwd.result,
});
const connection = new gcp.bigquery.Connection("connection", {
connectionId: "my-connection",
location: "US",
friendlyName: "👋",
description: "a riveting description",
cloud_sql: {
instanceId: instance.connectionName,
database: db.name,
type: "POSTGRES",
credential: {
username: user.name,
password: user.password,
},
},
});constructor
new Connection(name: string, args: ConnectionArgs, opts?: pulumi.CustomResourceOptions)Create a Connection resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ConnectionState, opts?: pulumi.CustomResourceOptions): ConnectionGet an existing Connection resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is ConnectionReturns true if the given object is an instance of Connection. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property cloudSql
public cloudSql: pulumi.Output<ConnectionCloudSql>;Cloud SQL properties. Structure is documented below.
property connectionId
public connectionId: pulumi.Output<string | undefined>;Optional connection id that should be assigned to the created connection.
property description
public description: pulumi.Output<string | undefined>;A descriptive description for the connection
property friendlyName
public friendlyName: pulumi.Output<string | undefined>;A descriptive name for the connection
property hasCredential
public hasCredential: pulumi.Output<boolean>;True if the connection has credential assigned.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property location
public location: pulumi.Output<string | undefined>;The geographic location where the connection should reside. Cloud SQL instance must be in the same location as the connection with following exceptions: Cloud SQL us-central1 maps to BigQuery US, Cloud SQL europe-west1 maps to BigQuery EU. Examples: US, EU, asia-northeast1, us-central1, europe-west1. The default value is US.
property name
public name: pulumi.Output<string>;The resource name of the connection in the form of: “projects/{project_id}/locations/{location_id}/connections/{connectionId}”
property project
public project: pulumi.Output<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource Dataset
class Dataset extends CustomResourceDatasets allow you to organize and control access to your tables.
To get more information about Dataset, see:
- API documentation
- How-to Guides
Example Usage - Bigquery Dataset Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const bqowner = new gcp.serviceAccount.Account("bqowner", {accountId: "bqowner"});
const dataset = new gcp.bigquery.Dataset("dataset", {
datasetId: "exampleDataset",
friendlyName: "test",
description: "This is a test description",
location: "EU",
defaultTableExpirationMs: 3600000,
labels: {
env: "default",
},
access: [
{
role: "OWNER",
userByEmail: bqowner.email,
},
{
role: "READER",
domain: "hashicorp.com",
},
],
});Example Usage - Bigquery Dataset Cmek
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const keyRing = new gcp.kms.KeyRing("keyRing", {location: "us"});
const cryptoKey = new gcp.kms.CryptoKey("cryptoKey", {keyRing: keyRing.id});
const dataset = new gcp.bigquery.Dataset("dataset", {
datasetId: "exampleDataset",
friendlyName: "test",
description: "This is a test description",
location: "US",
defaultTableExpirationMs: 3600000,
default_encryption_configuration: {
kmsKeyName: cryptoKey.id,
},
});constructor
new Dataset(name: string, args: DatasetArgs, opts?: pulumi.CustomResourceOptions)Create a Dataset resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatasetState, opts?: pulumi.CustomResourceOptions): DatasetGet an existing Dataset resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is DatasetReturns true if the given object is an instance of Dataset. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property accesses
public accesses: pulumi.Output<DatasetAccess[]>;An array of objects that define dataset access for one or more entities. Structure is documented below.
property creationTime
public creationTime: pulumi.Output<number>;The time when this dataset was created, in milliseconds since the epoch.
property datasetId
public datasetId: pulumi.Output<string>;The ID of the dataset containing this table.
property defaultEncryptionConfiguration
public defaultEncryptionConfiguration: pulumi.Output<DatasetDefaultEncryptionConfiguration | undefined>;The default encryption key for all tables in the dataset. Once this property is set, all newly-created partitioned tables in the dataset will have encryption key set to this value, unless table creation request (or query) overrides the key. Structure is documented below.
property defaultPartitionExpirationMs
public defaultPartitionExpirationMs: pulumi.Output<number | undefined>;The default partition expiration for all partitioned tables in the dataset, in milliseconds.
property defaultTableExpirationMs
public defaultTableExpirationMs: pulumi.Output<number | undefined>;The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour).
property deleteContentsOnDestroy
public deleteContentsOnDestroy: pulumi.Output<boolean | undefined>;If set to true, delete all the tables in the
dataset when destroying the resource; otherwise,
destroying the resource will fail if tables are present.
property description
public description: pulumi.Output<string | undefined>;A user-friendly description of the dataset
property etag
public etag: pulumi.Output<string>;A hash of the resource.
property friendlyName
public friendlyName: pulumi.Output<string | undefined>;A descriptive name for the dataset
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property labels
public labels: pulumi.Output<{[key: string]: string} | undefined>;The labels associated with this dataset. You can use these to organize and group your datasets
property lastModifiedTime
public lastModifiedTime: pulumi.Output<number>;The date when this dataset or any of its tables was last modified, in milliseconds since the epoch.
property location
public location: pulumi.Output<string | undefined>;The geographic location where the dataset should reside. See official docs.
property project
public project: pulumi.Output<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property selfLink
public selfLink: pulumi.Output<string>;The URI of the created resource.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource DatasetAccess
class DatasetAccess extends CustomResourceGives dataset access for a single entity. This resource is intended to be used in cases where
it is not possible to compile a full list of access blocks to include in a
gcp.bigquery.Dataset resource, to enable them to be added separately.
Note: If this resource is used alongside a
gcp.bigquery.Datasetresource, the dataset resource must either have no definedaccessblocks or alifecycleblock withignoreChanges = [access]so they don’t fight over which accesses should be on the dataset.
To get more information about DatasetAccess, see:
- API documentation
- How-to Guides
Example Usage - Bigquery Dataset Access Basic User
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const dataset = new gcp.bigquery.Dataset("dataset", {datasetId: "exampleDataset"});
const bqowner = new gcp.serviceAccount.Account("bqowner", {accountId: "bqowner"});
const access = new gcp.bigquery.DatasetAccess("access", {
datasetId: dataset.datasetId,
role: "OWNER",
userByEmail: bqowner.email,
});Example Usage - Bigquery Dataset Access View
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _private = new gcp.bigquery.Dataset("private", {datasetId: "exampleDataset"});
const publicDataset = new gcp.bigquery.Dataset("publicDataset", {datasetId: "exampleDataset2"});
const publicTable = new gcp.bigquery.Table("publicTable", {
datasetId: publicDataset.datasetId,
tableId: "exampleTable",
view: {
query: "SELECT state FROM [lookerdata:cdc.project_tycho_reports]",
useLegacySql: false,
},
});
const access = new gcp.bigquery.DatasetAccess("access", {
datasetId: _private.datasetId,
view: {
projectId: publicTable.project,
datasetId: publicDataset.datasetId,
tableId: publicTable.tableId,
},
});constructor
new DatasetAccess(name: string, args: DatasetAccessArgs, opts?: pulumi.CustomResourceOptions)Create a DatasetAccess resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatasetAccessState, opts?: pulumi.CustomResourceOptions): DatasetAccessGet an existing DatasetAccess resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is DatasetAccessReturns true if the given object is an instance of DatasetAccess. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property datasetId
public datasetId: pulumi.Output<string>;The ID of the dataset containing this table.
property domain
public domain: pulumi.Output<string | undefined>;A domain to grant access to. Any users signed in with the domain specified will be granted the specified access
property groupByEmail
public groupByEmail: pulumi.Output<string | undefined>;An email address of a Google Group to grant access to.
property iamMember
public iamMember: pulumi.Output<string | undefined>;Some other type of member that appears in the IAM Policy but isn’t a user,
group, domain, or special group. For example: allUsers
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property project
public project: pulumi.Output<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property role
public role: pulumi.Output<string | undefined>;Describes the rights granted to the user specified by the other member of the access object. Primitive, Predefined and custom roles are supported. Predefined roles that have equivalent primitive roles are swapped by the API to their Primitive counterparts, and will show a diff post-create. See official docs.
property specialGroup
public specialGroup: pulumi.Output<string | undefined>;A special group to grant access to. Possible values include:
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
property userByEmail
public userByEmail: pulumi.Output<string | undefined>;An email address of a user to grant access to. For example: fred@example.com
property view
public view: pulumi.Output<DatasetAccessView | undefined>;A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation. Structure is documented below.
Resource DataTransferConfig
class DataTransferConfig extends CustomResourceRepresents 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
- How-to Guides
Example Usage - Scheduled Query
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const project = gcp.organizations.getProject({});
const permissions = new gcp.projects.IAMMember("permissions", {
role: "roles/iam.serviceAccountShortTermTokenMinter",
member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-bigquerydatatransfer.iam.gserviceaccount.com`),
});
const myDataset = new gcp.bigquery.Dataset("myDataset", {
datasetId: "myDataset",
friendlyName: "foo",
description: "bar",
location: "asia-northeast1",
});
const queryConfig = new gcp.bigquery.DataTransferConfig("queryConfig", {
displayName: "my-query",
location: "asia-northeast1",
dataSourceId: "scheduledQuery",
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'",
},
});constructor
new DataTransferConfig(name: string, args: DataTransferConfigArgs, opts?: pulumi.CustomResourceOptions)Create a DataTransferConfig resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DataTransferConfigState, opts?: pulumi.CustomResourceOptions): DataTransferConfigGet an existing DataTransferConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is DataTransferConfigReturns 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.
property dataRefreshWindowDays
public dataRefreshWindowDays: pulumi.Output<number | undefined>;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.
property dataSourceId
public dataSourceId: pulumi.Output<string>;The data source id. Cannot be changed once the transfer config is created.
property destinationDatasetId
public destinationDatasetId: pulumi.Output<string>;The BigQuery target dataset id.
property disabled
public disabled: pulumi.Output<boolean | undefined>;When set to true, no runs are scheduled for a given transfer.
property displayName
public displayName: pulumi.Output<string>;The user specified display name for the transfer config.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property location
public location: pulumi.Output<string | undefined>;The geographic location where the transfer config should reside. Examples: US, EU, asia-northeast1. The default value is US.
property name
public name: pulumi.Output<string>;The resource name of the transfer config. Transfer config names have the form projects/{projectId}/locations/{location}/transferConfigs/{configId}. Where configId is usually a uuid, but this is not required. The name is ignored when creating a transfer config.
property params
public params: pulumi.Output<{[key: string]: string}>;These parameters are specific to each data source.
property project
public project: pulumi.Output<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property schedule
public schedule: pulumi.Output<string | undefined>;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.
property serviceAccountName
public serviceAccountName: pulumi.Output<string | undefined>;Optional service account name. 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.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource Job
class Job extends CustomResourceJobs are actions that BigQuery runs on your behalf to load data, export data, query data, or copy data. Once a BigQuery job is created, it cannot be changed or deleted.
Example Usage - Bigquery Job Query
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const bar = new gcp.bigquery.Dataset("bar", {
datasetId: "jobQueryDataset",
friendlyName: "test",
description: "This is a test description",
location: "US",
});
const foo = new gcp.bigquery.Table("foo", {
datasetId: bar.datasetId,
tableId: "jobQueryTable",
});
const job = new gcp.bigquery.Job("job", {
jobId: "jobQuery",
labels: {
"example-label": "example-value",
},
query: {
query: "SELECT state FROM [lookerdata:cdc.project_tycho_reports]",
destination_table: {
projectId: foo.project,
datasetId: foo.datasetId,
tableId: foo.tableId,
},
allowLargeResults: true,
flattenResults: true,
script_options: {
keyResultStatement: "LAST",
},
},
});Example Usage - Bigquery Job Query Table Reference
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const bar = new gcp.bigquery.Dataset("bar", {
datasetId: "jobQueryDataset",
friendlyName: "test",
description: "This is a test description",
location: "US",
});
const foo = new gcp.bigquery.Table("foo", {
datasetId: bar.datasetId,
tableId: "jobQueryTable",
});
const job = new gcp.bigquery.Job("job", {
jobId: "jobQuery",
labels: {
"example-label": "example-value",
},
query: {
query: "SELECT state FROM [lookerdata:cdc.project_tycho_reports]",
destination_table: {
tableId: foo.id,
},
default_dataset: {
datasetId: bar.id,
},
allowLargeResults: true,
flattenResults: true,
script_options: {
keyResultStatement: "LAST",
},
},
});Example Usage - Bigquery Job Load
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const bar = new gcp.bigquery.Dataset("bar", {
datasetId: "jobLoadDataset",
friendlyName: "test",
description: "This is a test description",
location: "US",
});
const foo = new gcp.bigquery.Table("foo", {
datasetId: bar.datasetId,
tableId: "jobLoadTable",
});
const job = new gcp.bigquery.Job("job", {
jobId: "jobLoad",
labels: {
my_job: "load",
},
load: {
sourceUris: ["gs://cloud-samples-data/bigquery/us-states/us-states-by-date.csv"],
destination_table: {
projectId: foo.project,
datasetId: foo.datasetId,
tableId: foo.tableId,
},
skipLeadingRows: 1,
schemaUpdateOptions: [
"ALLOW_FIELD_RELAXATION",
"ALLOW_FIELD_ADDITION",
],
writeDisposition: "WRITE_APPEND",
autodetect: true,
},
});Example Usage - Bigquery Job Extract
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const source_oneDataset = new gcp.bigquery.Dataset("source-oneDataset", {
datasetId: "jobExtractDataset",
friendlyName: "test",
description: "This is a test description",
location: "US",
});
const source_oneTable = new gcp.bigquery.Table("source-oneTable", {
datasetId: source_oneDataset.datasetId,
tableId: "jobExtractTable",
schema: `[
{
"name": "name",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "postAbbr",
"type": "STRING",
"mode": "NULLABLE"
},
{
"name": "date",
"type": "DATE",
"mode": "NULLABLE"
}
]
`,
});
const dest = new gcp.storage.Bucket("dest", {forceDestroy: true});
const job = new gcp.bigquery.Job("job", {
jobId: "jobExtract",
extract: {
destinationUris: [pulumi.interpolate`${dest.url}/extract`],
source_table: {
projectId: source_oneTable.project,
datasetId: source_oneTable.datasetId,
tableId: source_oneTable.tableId,
},
destinationFormat: "NEWLINE_DELIMITED_JSON",
compression: "GZIP",
},
});constructor
new Job(name: string, args: JobArgs, opts?: pulumi.CustomResourceOptions)Create a Job resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: JobState, opts?: pulumi.CustomResourceOptions): JobGet an existing Job resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is JobReturns true if the given object is an instance of Job. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property copy
public copy: pulumi.Output<JobCopy | undefined>;Copies a table. Structure is documented below.
property extract
public extract: pulumi.Output<JobExtract | undefined>;Configures an extract job. Structure is documented below.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property jobId
public jobId: pulumi.Output<string>;The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
property jobTimeoutMs
public jobTimeoutMs: pulumi.Output<string | undefined>;Job timeout in milliseconds. If this time limit is exceeded, BigQuery may attempt to terminate the job.
property jobType
public jobType: pulumi.Output<string>;The type of the job.
property labels
public labels: pulumi.Output<{[key: string]: string} | undefined>;The labels associated with this job. You can use these to organize and group your jobs.
property load
public load: pulumi.Output<JobLoad | undefined>;Configures a load job. Structure is documented below.
property location
public location: pulumi.Output<string | undefined>;The geographic location of the job. The default value is US.
property project
public project: pulumi.Output<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property query
public query: pulumi.Output<JobQuery | undefined>;Configures a query job. Structure is documented below.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
property userEmail
public userEmail: pulumi.Output<string>;Email address of the user who ran the job.
Resource Reservation
class Reservation extends CustomResourceA reservation is a mechanism used to guarantee BigQuery slots to users.
To get more information about Reservation, see:
- API documentation
- How-to Guides
Example Usage - Bigquery Reservation Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const reservation = new gcp.bigquery.Reservation("reservation", {
location: "asia-northeast1",
slotCapacity: 0,
ignoreIdleSlots: false,
});constructor
new Reservation(name: string, args: ReservationArgs, opts?: pulumi.CustomResourceOptions)Create a Reservation resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ReservationState, opts?: pulumi.CustomResourceOptions): ReservationGet an existing Reservation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is ReservationReturns true if the given object is an instance of Reservation. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property ignoreIdleSlots
public ignoreIdleSlots: pulumi.Output<boolean | undefined>;If false, any query using this reservation will use idle slots from other reservations within the same admin project. If true, a query using this reservation will execute with the slot capacity specified above at most.
property location
public location: pulumi.Output<string | undefined>;The geographic location where the transfer config should reside. Examples: US, EU, asia-northeast1. The default value is US.
property name
public name: pulumi.Output<string>;The name of the reservation. This field must only contain alphanumeric characters or dash.
property project
public project: pulumi.Output<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property slotCapacity
public slotCapacity: pulumi.Output<number>;Minimum slots available to this reservation. A slot is a unit of computational power in BigQuery, and serves as the unit of parallelism. Queries using this reservation might use more slots during runtime if ignoreIdleSlots is set to false.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
Resource Table
class Table extends CustomResourceCreates a table resource in a dataset for Google BigQuery. For more information see the official documentation and API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultDataset = new gcp.bigquery.Dataset("defaultDataset", {
datasetId: "foo",
friendlyName: "test",
description: "This is a test description",
location: "EU",
defaultTableExpirationMs: 3600000,
labels: {
env: "default",
},
});
const defaultTable = new gcp.bigquery.Table("defaultTable", {
datasetId: defaultDataset.datasetId,
tableId: "bar",
time_partitioning: {
type: "DAY",
},
labels: {
env: "default",
},
schema: `[
{
"name": "permalink",
"type": "STRING",
"mode": "NULLABLE",
"description": "The Permalink"
},
{
"name": "state",
"type": "STRING",
"mode": "NULLABLE",
"description": "State where the head office is located"
}
]
`,
});
const sheet = new gcp.bigquery.Table("sheet", {
datasetId: defaultDataset.datasetId,
tableId: "sheet",
external_data_configuration: {
autodetect: true,
sourceFormat: "GOOGLE_SHEETS",
google_sheets_options: {
skipLeadingRows: 1,
},
sourceUris: ["https://docs.google.com/spreadsheets/d/123456789012345"],
},
});constructor
new Table(name: string, args: TableArgs, opts?: pulumi.CustomResourceOptions)Create a Table resource with the given unique name, arguments, and options.
nameThe unique name of the resource.argsThe arguments to use to populate this resource's properties.optsA bag of options that control this resource's behavior.
method get
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TableState, opts?: pulumi.CustomResourceOptions): TableGet an existing Table resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
method getProvider
getProvider(moduleMember: string): ProviderResource | undefinedmethod isInstance
public static isInstance(obj: any): obj is TableReturns true if the given object is an instance of Table. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
property clusterings
public clusterings: pulumi.Output<string[] | undefined>;Specifies column names to use for data clustering. Up to four top-level columns are allowed, and should be specified in descending priority order.
property creationTime
public creationTime: pulumi.Output<number>;The time when this table was created, in milliseconds since the epoch.
property datasetId
public datasetId: pulumi.Output<string>;The dataset ID to create the table in. Changing this forces a new resource to be created.
property description
public description: pulumi.Output<string | undefined>;The field description.
property encryptionConfiguration
public encryptionConfiguration: pulumi.Output<TableEncryptionConfiguration | undefined>;Specifies how the table should be encrypted. If left blank, the table will be encrypted with a Google-managed key; that process is transparent to the user. Structure is documented below.
property etag
public etag: pulumi.Output<string>;A hash of the resource.
property expirationTime
public expirationTime: pulumi.Output<number>;The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
property externalDataConfiguration
public externalDataConfiguration: pulumi.Output<TableExternalDataConfiguration | undefined>;Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. Structure is documented below.
property friendlyName
public friendlyName: pulumi.Output<string | undefined>;A descriptive name for the table.
property id
id: Output<ID>;id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.
property labels
public labels: pulumi.Output<{[key: string]: string} | undefined>;A mapping of labels to assign to the resource.
property lastModifiedTime
public lastModifiedTime: pulumi.Output<number>;The time when this table was last modified, in milliseconds since the epoch.
property location
public location: pulumi.Output<string>;The geographic location where the table resides. This value is inherited from the dataset.
property numBytes
public numBytes: pulumi.Output<number>;The size of this table in bytes, excluding any data in the streaming buffer.
property numLongTermBytes
public numLongTermBytes: pulumi.Output<number>;The number of bytes in the table that are considered “long-term storage”.
property numRows
public numRows: pulumi.Output<number>;The number of rows of data in this table, excluding any data in the streaming buffer.
property project
public project: pulumi.Output<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property rangePartitioning
public rangePartitioning: pulumi.Output<TableRangePartitioning | undefined>;If specified, configures range-based partitioning for this table. Structure is documented below.
property schema
public schema: pulumi.Output<string>;A JSON schema for the table. Schema is required
for CSV and JSON formats and is disallowed for Google Cloud
Bigtable, Cloud Datastore backups, and Avro formats when using
external tables. For more information see the
BigQuery API documentation.
~>NOTE: Because this field expects a JSON string, any changes to the
string will create a diff, even if the JSON itself hasn’t changed.
If the API returns a different value for the same schema, e.g. it
switched the order of values or replaced STRUCT field type with RECORD
field type, we currently cannot suppress the recurring diff this causes.
As a workaround, we recommend using the schema as returned by the API.
property selfLink
public selfLink: pulumi.Output<string>;The URI of the created resource.
property tableId
public tableId: pulumi.Output<string>;A unique ID for the resource. Changing this forces a new resource to be created.
property timePartitioning
public timePartitioning: pulumi.Output<TableTimePartitioning | undefined>;If specified, configures time-based partitioning for this table. Structure is documented below.
property type
public type: pulumi.Output<string>;The only type supported is DAY, which will generate one partition per day based on data loading time.
property urn
urn: Output<URN>;urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
property view
public view: pulumi.Output<TableView | undefined>;If specified, configures this table as a view. Structure is documented below.
Functions
Function getDefaultServiceAccount
getDefaultServiceAccount(args?: GetDefaultServiceAccountArgs, opts?: pulumi.InvokeOptions): Promise<GetDefaultServiceAccountResult>Get the email address of a project’s unique BigQuery service account.
Each Google Cloud project has a unique service account used by BigQuery. When using
BigQuery with customer-managed encryption keys,
this account needs to be granted the
cloudkms.cryptoKeyEncrypterDecrypter IAM role on the customer-managed Cloud KMS key used to protect the data.
For more information see the API reference.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const bqSa = gcp.bigquery.getDefaultServiceAccount({});
const keySaUser = new gcp.kms.CryptoKeyIAMMember("keySaUser", {
cryptoKeyId: google_kms_crypto_key.key.id,
role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
member: bqSa.then(bqSa => `serviceAccount:${bqSa.email}`),
});Others
interface AppProfileArgs
interface AppProfileArgsThe set of arguments for constructing a AppProfile resource.
property appProfileId
appProfileId: pulumi.Input<string>;The unique name of the app profile in the form [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
property description
description?: pulumi.Input<string>;Long form description of the use case for this app profile.
property ignoreWarnings
ignoreWarnings?: pulumi.Input<boolean>;If true, ignore safety checks when deleting/updating the app profile.
property instance
instance?: pulumi.Input<string>;The name of the instance to create the app profile within.
property multiClusterRoutingUseAny
multiClusterRoutingUseAny?: pulumi.Input<boolean>;If true, read/write requests are routed to the nearest cluster in the instance, and will fail over to the nearest cluster that is available in the event of transient errors or delays. Clusters in a region are considered equidistant. Choosing this option sacrifices read-your-writes consistency to improve availability.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property singleClusterRouting
singleClusterRouting?: pulumi.Input<AppProfileSingleClusterRouting>;Use a single-cluster routing policy. Structure is documented below.
interface AppProfileState
interface AppProfileStateInput properties used for looking up and filtering AppProfile resources.
property appProfileId
appProfileId?: pulumi.Input<string>;The unique name of the app profile in the form [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
property description
description?: pulumi.Input<string>;Long form description of the use case for this app profile.
property ignoreWarnings
ignoreWarnings?: pulumi.Input<boolean>;If true, ignore safety checks when deleting/updating the app profile.
property instance
instance?: pulumi.Input<string>;The name of the instance to create the app profile within.
property multiClusterRoutingUseAny
multiClusterRoutingUseAny?: pulumi.Input<boolean>;If true, read/write requests are routed to the nearest cluster in the instance, and will fail over to the nearest cluster that is available in the event of transient errors or delays. Clusters in a region are considered equidistant. Choosing this option sacrifices read-your-writes consistency to improve availability.
property name
name?: pulumi.Input<string>;The unique name of the requested app profile. Values are of the form
‘projects/
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property singleClusterRouting
singleClusterRouting?: pulumi.Input<AppProfileSingleClusterRouting>;Use a single-cluster routing policy. Structure is documented below.
interface ConnectionArgs
interface ConnectionArgsThe set of arguments for constructing a Connection resource.
property cloudSql
cloudSql: pulumi.Input<ConnectionCloudSql>;Cloud SQL properties. Structure is documented below.
property connectionId
connectionId?: pulumi.Input<string>;Optional connection id that should be assigned to the created connection.
property description
description?: pulumi.Input<string>;A descriptive description for the connection
property friendlyName
friendlyName?: pulumi.Input<string>;A descriptive name for the connection
property location
location?: pulumi.Input<string>;The geographic location where the connection should reside. Cloud SQL instance must be in the same location as the connection with following exceptions: Cloud SQL us-central1 maps to BigQuery US, Cloud SQL europe-west1 maps to BigQuery EU. Examples: US, EU, asia-northeast1, us-central1, europe-west1. The default value is US.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
interface ConnectionState
interface ConnectionStateInput properties used for looking up and filtering Connection resources.
property cloudSql
cloudSql?: pulumi.Input<ConnectionCloudSql>;Cloud SQL properties. Structure is documented below.
property connectionId
connectionId?: pulumi.Input<string>;Optional connection id that should be assigned to the created connection.
property description
description?: pulumi.Input<string>;A descriptive description for the connection
property friendlyName
friendlyName?: pulumi.Input<string>;A descriptive name for the connection
property hasCredential
hasCredential?: pulumi.Input<boolean>;True if the connection has credential assigned.
property location
location?: pulumi.Input<string>;The geographic location where the connection should reside. Cloud SQL instance must be in the same location as the connection with following exceptions: Cloud SQL us-central1 maps to BigQuery US, Cloud SQL europe-west1 maps to BigQuery EU. Examples: US, EU, asia-northeast1, us-central1, europe-west1. The default value is US.
property name
name?: pulumi.Input<string>;The resource name of the connection in the form of: “projects/{project_id}/locations/{location_id}/connections/{connectionId}”
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
interface DatasetAccessArgs
interface DatasetAccessArgsThe set of arguments for constructing a DatasetAccess resource.
property datasetId
datasetId: pulumi.Input<string>;The ID of the dataset containing this table.
property domain
domain?: pulumi.Input<string>;A domain to grant access to. Any users signed in with the domain specified will be granted the specified access
property groupByEmail
groupByEmail?: pulumi.Input<string>;An email address of a Google Group to grant access to.
property iamMember
iamMember?: pulumi.Input<string>;Some other type of member that appears in the IAM Policy but isn’t a user,
group, domain, or special group. For example: allUsers
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property role
role?: pulumi.Input<string>;Describes the rights granted to the user specified by the other member of the access object. Primitive, Predefined and custom roles are supported. Predefined roles that have equivalent primitive roles are swapped by the API to their Primitive counterparts, and will show a diff post-create. See official docs.
property specialGroup
specialGroup?: pulumi.Input<string>;A special group to grant access to. Possible values include:
property userByEmail
userByEmail?: pulumi.Input<string>;An email address of a user to grant access to. For example: fred@example.com
property view
view?: pulumi.Input<DatasetAccessView>;A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation. Structure is documented below.
interface DatasetAccessState
interface DatasetAccessStateInput properties used for looking up and filtering DatasetAccess resources.
property datasetId
datasetId?: pulumi.Input<string>;The ID of the dataset containing this table.
property domain
domain?: pulumi.Input<string>;A domain to grant access to. Any users signed in with the domain specified will be granted the specified access
property groupByEmail
groupByEmail?: pulumi.Input<string>;An email address of a Google Group to grant access to.
property iamMember
iamMember?: pulumi.Input<string>;Some other type of member that appears in the IAM Policy but isn’t a user,
group, domain, or special group. For example: allUsers
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property role
role?: pulumi.Input<string>;Describes the rights granted to the user specified by the other member of the access object. Primitive, Predefined and custom roles are supported. Predefined roles that have equivalent primitive roles are swapped by the API to their Primitive counterparts, and will show a diff post-create. See official docs.
property specialGroup
specialGroup?: pulumi.Input<string>;A special group to grant access to. Possible values include:
property userByEmail
userByEmail?: pulumi.Input<string>;An email address of a user to grant access to. For example: fred@example.com
property view
view?: pulumi.Input<DatasetAccessView>;A view from a different dataset to grant access to. Queries executed against that view will have read access to tables in this dataset. The role field is not required when this field is set. If that view is updated by any user, access to the view needs to be granted again via an update operation. Structure is documented below.
interface DatasetArgs
interface DatasetArgsThe set of arguments for constructing a Dataset resource.
property accesses
accesses?: pulumi.Input<pulumi.Input<DatasetAccess>[]>;An array of objects that define dataset access for one or more entities. Structure is documented below.
property datasetId
datasetId: pulumi.Input<string>;The ID of the dataset containing this table.
property defaultEncryptionConfiguration
defaultEncryptionConfiguration?: pulumi.Input<DatasetDefaultEncryptionConfiguration>;The default encryption key for all tables in the dataset. Once this property is set, all newly-created partitioned tables in the dataset will have encryption key set to this value, unless table creation request (or query) overrides the key. Structure is documented below.
property defaultPartitionExpirationMs
defaultPartitionExpirationMs?: pulumi.Input<number>;The default partition expiration for all partitioned tables in the dataset, in milliseconds.
property defaultTableExpirationMs
defaultTableExpirationMs?: pulumi.Input<number>;The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour).
property deleteContentsOnDestroy
deleteContentsOnDestroy?: pulumi.Input<boolean>;If set to true, delete all the tables in the
dataset when destroying the resource; otherwise,
destroying the resource will fail if tables are present.
property description
description?: pulumi.Input<string>;A user-friendly description of the dataset
property friendlyName
friendlyName?: pulumi.Input<string>;A descriptive name for the dataset
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;The labels associated with this dataset. You can use these to organize and group your datasets
property location
location?: pulumi.Input<string>;The geographic location where the dataset should reside. See official docs.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
interface DatasetState
interface DatasetStateInput properties used for looking up and filtering Dataset resources.
property accesses
accesses?: pulumi.Input<pulumi.Input<DatasetAccess>[]>;An array of objects that define dataset access for one or more entities. Structure is documented below.
property creationTime
creationTime?: pulumi.Input<number>;The time when this dataset was created, in milliseconds since the epoch.
property datasetId
datasetId?: pulumi.Input<string>;The ID of the dataset containing this table.
property defaultEncryptionConfiguration
defaultEncryptionConfiguration?: pulumi.Input<DatasetDefaultEncryptionConfiguration>;The default encryption key for all tables in the dataset. Once this property is set, all newly-created partitioned tables in the dataset will have encryption key set to this value, unless table creation request (or query) overrides the key. Structure is documented below.
property defaultPartitionExpirationMs
defaultPartitionExpirationMs?: pulumi.Input<number>;The default partition expiration for all partitioned tables in the dataset, in milliseconds.
property defaultTableExpirationMs
defaultTableExpirationMs?: pulumi.Input<number>;The default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour).
property deleteContentsOnDestroy
deleteContentsOnDestroy?: pulumi.Input<boolean>;If set to true, delete all the tables in the
dataset when destroying the resource; otherwise,
destroying the resource will fail if tables are present.
property description
description?: pulumi.Input<string>;A user-friendly description of the dataset
property etag
etag?: pulumi.Input<string>;A hash of the resource.
property friendlyName
friendlyName?: pulumi.Input<string>;A descriptive name for the dataset
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;The labels associated with this dataset. You can use these to organize and group your datasets
property lastModifiedTime
lastModifiedTime?: pulumi.Input<number>;The date when this dataset or any of its tables was last modified, in milliseconds since the epoch.
property location
location?: pulumi.Input<string>;The geographic location where the dataset should reside. See official docs.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property selfLink
selfLink?: pulumi.Input<string>;The URI of the created resource.
interface DataTransferConfigArgs
interface DataTransferConfigArgsThe set of arguments for constructing a DataTransferConfig resource.
property dataRefreshWindowDays
dataRefreshWindowDays?: pulumi.Input<number>;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.
property dataSourceId
dataSourceId: pulumi.Input<string>;The data source id. Cannot be changed once the transfer config is created.
property destinationDatasetId
destinationDatasetId: pulumi.Input<string>;The BigQuery target dataset id.
property disabled
disabled?: pulumi.Input<boolean>;When set to true, no runs are scheduled for a given transfer.
property displayName
displayName: pulumi.Input<string>;The user specified display name for the transfer config.
property location
location?: pulumi.Input<string>;The geographic location where the transfer config should reside. Examples: US, EU, asia-northeast1. The default value is US.
property params
params: pulumi.Input<{[key: string]: pulumi.Input<string>}>;These parameters are specific to each data source.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property schedule
schedule?: 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 granularity should be at least 8 hours, or less frequent.
property serviceAccountName
serviceAccountName?: pulumi.Input<string>;Optional service account name. 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.
interface DataTransferConfigState
interface DataTransferConfigStateInput properties used for looking up and filtering DataTransferConfig resources.
property dataRefreshWindowDays
dataRefreshWindowDays?: pulumi.Input<number>;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.
property dataSourceId
dataSourceId?: pulumi.Input<string>;The data source id. Cannot be changed once the transfer config is created.
property destinationDatasetId
destinationDatasetId?: pulumi.Input<string>;The BigQuery target dataset id.
property disabled
disabled?: pulumi.Input<boolean>;When set to true, no runs are scheduled for a given transfer.
property displayName
displayName?: pulumi.Input<string>;The user specified display name for the transfer config.
property location
location?: pulumi.Input<string>;The geographic location where the transfer config should reside. Examples: US, EU, asia-northeast1. The default value is US.
property name
name?: pulumi.Input<string>;The resource name of the transfer config. Transfer config names have the form projects/{projectId}/locations/{location}/transferConfigs/{configId}. Where configId is usually a uuid, but this is not required. The name is ignored when creating a transfer config.
property params
params?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;These parameters are specific to each data source.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property schedule
schedule?: 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 granularity should be at least 8 hours, or less frequent.
property serviceAccountName
serviceAccountName?: pulumi.Input<string>;Optional service account name. 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.
interface GetDefaultServiceAccountArgs
interface GetDefaultServiceAccountArgsA collection of arguments for invoking getDefaultServiceAccount.
property project
project?: undefined | string;The project the unique service account was created for. If it is not provided, the provider project is used.
interface GetDefaultServiceAccountResult
interface GetDefaultServiceAccountResultA collection of values returned by getDefaultServiceAccount.
property email
email: string;The email address of the service account. This value is often used to refer to the service account in order to grant IAM permissions.
property id
id: string;The provider-assigned unique ID for this managed resource.
property project
project: string;interface JobArgs
interface JobArgsThe set of arguments for constructing a Job resource.
property copy
copy?: pulumi.Input<JobCopy>;Copies a table. Structure is documented below.
property extract
extract?: pulumi.Input<JobExtract>;Configures an extract job. Structure is documented below.
property jobId
jobId: pulumi.Input<string>;The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
property jobTimeoutMs
jobTimeoutMs?: pulumi.Input<string>;Job timeout in milliseconds. If this time limit is exceeded, BigQuery may attempt to terminate the job.
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;The labels associated with this job. You can use these to organize and group your jobs.
property load
load?: pulumi.Input<JobLoad>;Configures a load job. Structure is documented below.
property location
location?: pulumi.Input<string>;The geographic location of the job. The default value is US.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property query
query?: pulumi.Input<JobQuery>;Configures a query job. Structure is documented below.
interface JobState
interface JobStateInput properties used for looking up and filtering Job resources.
property copy
copy?: pulumi.Input<JobCopy>;Copies a table. Structure is documented below.
property extract
extract?: pulumi.Input<JobExtract>;Configures an extract job. Structure is documented below.
property jobId
jobId?: pulumi.Input<string>;The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
property jobTimeoutMs
jobTimeoutMs?: pulumi.Input<string>;Job timeout in milliseconds. If this time limit is exceeded, BigQuery may attempt to terminate the job.
property jobType
jobType?: pulumi.Input<string>;The type of the job.
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;The labels associated with this job. You can use these to organize and group your jobs.
property load
load?: pulumi.Input<JobLoad>;Configures a load job. Structure is documented below.
property location
location?: pulumi.Input<string>;The geographic location of the job. The default value is US.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property query
query?: pulumi.Input<JobQuery>;Configures a query job. Structure is documented below.
property userEmail
userEmail?: pulumi.Input<string>;Email address of the user who ran the job.
interface ReservationArgs
interface ReservationArgsThe set of arguments for constructing a Reservation resource.
property ignoreIdleSlots
ignoreIdleSlots?: pulumi.Input<boolean>;If false, any query using this reservation will use idle slots from other reservations within the same admin project. If true, a query using this reservation will execute with the slot capacity specified above at most.
property location
location?: pulumi.Input<string>;The geographic location where the transfer config should reside. Examples: US, EU, asia-northeast1. The default value is US.
property name
name?: pulumi.Input<string>;The name of the reservation. This field must only contain alphanumeric characters or dash.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property slotCapacity
slotCapacity: pulumi.Input<number>;Minimum slots available to this reservation. A slot is a unit of computational power in BigQuery, and serves as the unit of parallelism. Queries using this reservation might use more slots during runtime if ignoreIdleSlots is set to false.
interface ReservationState
interface ReservationStateInput properties used for looking up and filtering Reservation resources.
property ignoreIdleSlots
ignoreIdleSlots?: pulumi.Input<boolean>;If false, any query using this reservation will use idle slots from other reservations within the same admin project. If true, a query using this reservation will execute with the slot capacity specified above at most.
property location
location?: pulumi.Input<string>;The geographic location where the transfer config should reside. Examples: US, EU, asia-northeast1. The default value is US.
property name
name?: pulumi.Input<string>;The name of the reservation. This field must only contain alphanumeric characters or dash.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property slotCapacity
slotCapacity?: pulumi.Input<number>;Minimum slots available to this reservation. A slot is a unit of computational power in BigQuery, and serves as the unit of parallelism. Queries using this reservation might use more slots during runtime if ignoreIdleSlots is set to false.
interface TableArgs
interface TableArgsThe set of arguments for constructing a Table resource.
property clusterings
clusterings?: pulumi.Input<pulumi.Input<string>[]>;Specifies column names to use for data clustering. Up to four top-level columns are allowed, and should be specified in descending priority order.
property datasetId
datasetId: pulumi.Input<string>;The dataset ID to create the table in. Changing this forces a new resource to be created.
property description
description?: pulumi.Input<string>;The field description.
property encryptionConfiguration
encryptionConfiguration?: pulumi.Input<TableEncryptionConfiguration>;Specifies how the table should be encrypted. If left blank, the table will be encrypted with a Google-managed key; that process is transparent to the user. Structure is documented below.
property expirationTime
expirationTime?: pulumi.Input<number>;The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
property externalDataConfiguration
externalDataConfiguration?: pulumi.Input<TableExternalDataConfiguration>;Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. Structure is documented below.
property friendlyName
friendlyName?: pulumi.Input<string>;A descriptive name for the table.
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;A mapping of labels to assign to the resource.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property rangePartitioning
rangePartitioning?: pulumi.Input<TableRangePartitioning>;If specified, configures range-based partitioning for this table. Structure is documented below.
property schema
schema?: pulumi.Input<string>;A JSON schema for the table. Schema is required
for CSV and JSON formats and is disallowed for Google Cloud
Bigtable, Cloud Datastore backups, and Avro formats when using
external tables. For more information see the
BigQuery API documentation.
~>NOTE: Because this field expects a JSON string, any changes to the
string will create a diff, even if the JSON itself hasn’t changed.
If the API returns a different value for the same schema, e.g. it
switched the order of values or replaced STRUCT field type with RECORD
field type, we currently cannot suppress the recurring diff this causes.
As a workaround, we recommend using the schema as returned by the API.
property tableId
tableId: pulumi.Input<string>;A unique ID for the resource. Changing this forces a new resource to be created.
property timePartitioning
timePartitioning?: pulumi.Input<TableTimePartitioning>;If specified, configures time-based partitioning for this table. Structure is documented below.
property view
view?: pulumi.Input<TableView>;If specified, configures this table as a view. Structure is documented below.
interface TableState
interface TableStateInput properties used for looking up and filtering Table resources.
property clusterings
clusterings?: pulumi.Input<pulumi.Input<string>[]>;Specifies column names to use for data clustering. Up to four top-level columns are allowed, and should be specified in descending priority order.
property creationTime
creationTime?: pulumi.Input<number>;The time when this table was created, in milliseconds since the epoch.
property datasetId
datasetId?: pulumi.Input<string>;The dataset ID to create the table in. Changing this forces a new resource to be created.
property description
description?: pulumi.Input<string>;The field description.
property encryptionConfiguration
encryptionConfiguration?: pulumi.Input<TableEncryptionConfiguration>;Specifies how the table should be encrypted. If left blank, the table will be encrypted with a Google-managed key; that process is transparent to the user. Structure is documented below.
property etag
etag?: pulumi.Input<string>;A hash of the resource.
property expirationTime
expirationTime?: pulumi.Input<number>;The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. Expired tables will be deleted and their storage reclaimed.
property externalDataConfiguration
externalDataConfiguration?: pulumi.Input<TableExternalDataConfiguration>;Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. Structure is documented below.
property friendlyName
friendlyName?: pulumi.Input<string>;A descriptive name for the table.
property labels
labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;A mapping of labels to assign to the resource.
property lastModifiedTime
lastModifiedTime?: pulumi.Input<number>;The time when this table was last modified, in milliseconds since the epoch.
property location
location?: pulumi.Input<string>;The geographic location where the table resides. This value is inherited from the dataset.
property numBytes
numBytes?: pulumi.Input<number>;The size of this table in bytes, excluding any data in the streaming buffer.
property numLongTermBytes
numLongTermBytes?: pulumi.Input<number>;The number of bytes in the table that are considered “long-term storage”.
property numRows
numRows?: pulumi.Input<number>;The number of rows of data in this table, excluding any data in the streaming buffer.
property project
project?: pulumi.Input<string>;The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
property rangePartitioning
rangePartitioning?: pulumi.Input<TableRangePartitioning>;If specified, configures range-based partitioning for this table. Structure is documented below.
property schema
schema?: pulumi.Input<string>;A JSON schema for the table. Schema is required
for CSV and JSON formats and is disallowed for Google Cloud
Bigtable, Cloud Datastore backups, and Avro formats when using
external tables. For more information see the
BigQuery API documentation.
~>NOTE: Because this field expects a JSON string, any changes to the
string will create a diff, even if the JSON itself hasn’t changed.
If the API returns a different value for the same schema, e.g. it
switched the order of values or replaced STRUCT field type with RECORD
field type, we currently cannot suppress the recurring diff this causes.
As a workaround, we recommend using the schema as returned by the API.
property selfLink
selfLink?: pulumi.Input<string>;The URI of the created resource.
property tableId
tableId?: pulumi.Input<string>;A unique ID for the resource. Changing this forces a new resource to be created.
property timePartitioning
timePartitioning?: pulumi.Input<TableTimePartitioning>;If specified, configures time-based partitioning for this table. Structure is documented below.
property type
type?: pulumi.Input<string>;The only type supported is DAY, which will generate one partition per day based on data loading time.
property view
view?: pulumi.Input<TableView>;If specified, configures this table as a view. Structure is documented below.