Google Cloud v8.34.0 published on Wednesday, Jun 11, 2025 by Pulumi
gcp.bigquery.getDatasets
Explore with Pulumi AI
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",
});
import pulumi
import pulumi_gcp as gcp
datasets = gcp.bigquery.get_datasets(project="my-project")
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
})
}
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",
});
});
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());
}
}
variables:
datasets:
fn::invoke:
function: gcp:bigquery:getDatasets
arguments:
project: my-project
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>
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]
func GetDatasets(ctx *Context, args *GetDatasetsArgs, opts ...InvokeOption) (*GetDatasetsResult, error)
func GetDatasetsOutput(ctx *Context, args *GetDatasetsOutputArgs, opts ...InvokeOption) GetDatasetsResultOutput
> 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)
}
public static CompletableFuture<GetDatasetsResult> getDatasets(GetDatasetsArgs args, InvokeOptions options)
public static Output<GetDatasetsResult> getDatasets(GetDatasetsArgs args, InvokeOptions options)
fn::invoke:
function: gcp:bigquery/getDatasets:getDatasets
arguments:
# arguments dictionary
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<Get
Datasets Dataset> - 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
[]Get
Datasets Dataset - 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<Get
Datasets Dataset> - 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
Get
Datasets Dataset[] - 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[Get
Datasets Dataset] - 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
- Dataset
Id string - The id of the dataset.
- Friendly
Name string - The friendly name of the dataset.
- Labels Dictionary<string, string>
- User-provided dataset labels, in key/value pairs.
- Location string
- The geographic location of the dataset.
- Dataset
Id string - The id of the dataset.
- Friendly
Name string - The friendly name of the dataset.
- Labels map[string]string
- User-provided dataset labels, in key/value pairs.
- Location string
- The geographic location of the dataset.
- dataset
Id String - The id of the dataset.
- friendly
Name String - The friendly name of the dataset.
- labels Map<String,String>
- User-provided dataset labels, in key/value pairs.
- location String
- The geographic location of the dataset.
- dataset
Id string - The id of the dataset.
- friendly
Name string - The friendly name of the dataset.
- labels {[key: string]: string}
- User-provided dataset labels, in key/value pairs.
- location string
- The geographic location of the dataset.
- dataset_
id str - The id of the dataset.
- friendly_
name str - The friendly name of the dataset.
- labels Mapping[str, str]
- User-provided dataset labels, in key/value pairs.
- location str
- The geographic location of the dataset.
- dataset
Id String - The id of the dataset.
- friendly
Name String - The friendly name of the dataset.
- labels Map<String>
- User-provided dataset labels, in key/value pairs.
- location 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.