getProject

Use this data source to get project details. For more information see API

Example Usage

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var project = Output.Create(Gcp.Organizations.GetProject.InvokeAsync());
        this.ProjectNumber = project.Apply(project => project.Number);
    }

    [Output("projectNumber")]
    public Output<string> ProjectNumber { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/organizations"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		project, err := organizations.LookupProject(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("projectNumber", project.Number)
		return nil
	})
}
import pulumi
import pulumi_gcp as gcp

project = gcp.organizations.get_project()
pulumi.export("projectNumber", project.number)
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const project = gcp.organizations.getProject({});
export const projectNumber = project.then(project => project.number);

Using getProject

function getProject(args: GetProjectArgs, opts?: InvokeOptions): Promise<GetProjectResult>
def get_project(project_id: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetProjectResult
func LookupProject(ctx *Context, args *LookupProjectArgs, opts ...InvokeOption) (*LookupProjectResult, error)

Note: This function is named LookupProject in the Go SDK.

public static class GetProject {
    public static Task<GetProjectResult> InvokeAsync(GetProjectArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

ProjectId string
The project ID. If it is not provided, the provider project is used.
ProjectId string
The project ID. If it is not provided, the provider project is used.
projectId string
The project ID. If it is not provided, the provider project is used.
project_id str
The project ID. If it is not provided, the provider project is used.

getProject Result

The following output properties are available:

AutoCreateNetwork bool
BillingAccount string
FolderId string
Id string
The provider-assigned unique ID for this managed resource.
Labels Dictionary<string, string>
Name string
Number string
OrgId string
SkipDelete bool
ProjectId string
AutoCreateNetwork bool
BillingAccount string
FolderId string
Id string
The provider-assigned unique ID for this managed resource.
Labels map[string]string
Name string
Number string
OrgId string
SkipDelete bool
ProjectId string
autoCreateNetwork boolean
billingAccount string
folderId string
id string
The provider-assigned unique ID for this managed resource.
labels {[key: string]: string}
name string
number string
orgId string
skipDelete boolean
projectId string
auto_create_network bool
billing_account str
folder_id str
id str
The provider-assigned unique ID for this managed resource.
labels Mapping[str, str]
name str
number str
org_id str
skip_delete bool
project_id str

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.