1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. bigquery
  5. getDatasets
Google Cloud v8.35.0 published on Wednesday, Jun 18, 2025 by Pulumi

gcp.bigquery.getDatasets

Explore with Pulumi AI

Google Cloud v8.35.0 published on Wednesday, Jun 18, 2025 by Pulumi

Get a list of datasets in a GCP project. For more information see the official documentation and API.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const datasets = gcp.bigquery.getDatasets({
    project: "my-project",
});
Copy
import pulumi
import pulumi_gcp as gcp

datasets = gcp.bigquery.get_datasets(project="my-project")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/bigquery"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := bigquery.GetDatasets(ctx, &bigquery.GetDatasetsArgs{
			Project: pulumi.StringRef("my-project"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var datasets = Gcp.BigQuery.GetDatasets.Invoke(new()
    {
        Project = "my-project",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.bigquery.BigqueryFunctions;
import com.pulumi.gcp.bigquery.inputs.GetDatasetsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var datasets = BigqueryFunctions.getDatasets(GetDatasetsArgs.builder()
            .project("my-project")
            .build());

    }
}
Copy
variables:
  datasets:
    fn::invoke:
      function: gcp:bigquery:getDatasets
      arguments:
        project: my-project
Copy

Using getDatasets

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getDatasets(args: GetDatasetsArgs, opts?: InvokeOptions): Promise<GetDatasetsResult>
function getDatasetsOutput(args: GetDatasetsOutputArgs, opts?: InvokeOptions): Output<GetDatasetsResult>
Copy
def get_datasets(project: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetDatasetsResult
def get_datasets_output(project: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetDatasetsResult]
Copy
func GetDatasets(ctx *Context, args *GetDatasetsArgs, opts ...InvokeOption) (*GetDatasetsResult, error)
func GetDatasetsOutput(ctx *Context, args *GetDatasetsOutputArgs, opts ...InvokeOption) GetDatasetsResultOutput
Copy

> Note: This function is named GetDatasets in the Go SDK.

public static class GetDatasets 
{
    public static Task<GetDatasetsResult> InvokeAsync(GetDatasetsArgs args, InvokeOptions? opts = null)
    public static Output<GetDatasetsResult> Invoke(GetDatasetsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDatasetsResult> getDatasets(GetDatasetsArgs args, InvokeOptions options)
public static Output<GetDatasetsResult> getDatasets(GetDatasetsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:bigquery/getDatasets:getDatasets
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

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

getDatasets Result

The following output properties are available:

Datasets List<GetDatasetsDataset>
A list of all retrieved BigQuery datasets. Structure is defined below.
Id string
The provider-assigned unique ID for this managed resource.
Project string
Datasets []GetDatasetsDataset
A list of all retrieved BigQuery datasets. Structure is defined below.
Id string
The provider-assigned unique ID for this managed resource.
Project string
datasets List<GetDatasetsDataset>
A list of all retrieved BigQuery datasets. Structure is defined below.
id String
The provider-assigned unique ID for this managed resource.
project String
datasets GetDatasetsDataset[]
A list of all retrieved BigQuery datasets. Structure is defined below.
id string
The provider-assigned unique ID for this managed resource.
project string
datasets Sequence[GetDatasetsDataset]
A list of all retrieved BigQuery datasets. Structure is defined below.
id str
The provider-assigned unique ID for this managed resource.
project str
datasets List<Property Map>
A list of all retrieved BigQuery datasets. Structure is defined below.
id String
The provider-assigned unique ID for this managed resource.
project String

Supporting Types

GetDatasetsDataset

DatasetId This property is required. string
The id of the dataset.
FriendlyName This property is required. string
The friendly name of the dataset.
Labels This property is required. Dictionary<string, string>
User-provided dataset labels, in key/value pairs.
Location This property is required. string
The geographic location of the dataset.
DatasetId This property is required. string
The id of the dataset.
FriendlyName This property is required. string
The friendly name of the dataset.
Labels This property is required. map[string]string
User-provided dataset labels, in key/value pairs.
Location This property is required. string
The geographic location of the dataset.
datasetId This property is required. String
The id of the dataset.
friendlyName This property is required. String
The friendly name of the dataset.
labels This property is required. Map<String,String>
User-provided dataset labels, in key/value pairs.
location This property is required. String
The geographic location of the dataset.
datasetId This property is required. string
The id of the dataset.
friendlyName This property is required. string
The friendly name of the dataset.
labels This property is required. {[key: string]: string}
User-provided dataset labels, in key/value pairs.
location This property is required. string
The geographic location of the dataset.
dataset_id This property is required. str
The id of the dataset.
friendly_name This property is required. str
The friendly name of the dataset.
labels This property is required. Mapping[str, str]
User-provided dataset labels, in key/value pairs.
location This property is required. str
The geographic location of the dataset.
datasetId This property is required. String
The id of the dataset.
friendlyName This property is required. String
The friendly name of the dataset.
labels This property is required. Map<String>
User-provided dataset labels, in key/value pairs.
location This property is required. String
The geographic location of the dataset.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.
Google Cloud v8.35.0 published on Wednesday, Jun 18, 2025 by Pulumi