Google Cloud (GCP) Classic
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/v6/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
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var project = Output.of(OrganizationsFunctions.getProject());
ctx.export("projectNumber", project.apply(getProjectResult -> getProjectResult.getNumber()));
}
}
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);
variables:
project:
Fn::Invoke:
Function: gcp:organizations:getProject
Arguments: {}
outputs:
projectNumber: ${project.number}
Using getProject
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 getProject(args: GetProjectArgs, opts?: InvokeOptions): Promise<GetProjectResult>
function getProjectOutput(args: GetProjectOutputArgs, opts?: InvokeOptions): Output<GetProjectResult>
def get_project(project_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetProjectResult
def get_project_output(project_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetProjectResult]
func LookupProject(ctx *Context, args *LookupProjectArgs, opts ...InvokeOption) (*LookupProjectResult, error)
func LookupProjectOutput(ctx *Context, args *LookupProjectOutputArgs, opts ...InvokeOption) LookupProjectResultOutput
> Note: This function is named LookupProject
in the Go SDK.
public static class GetProject
{
public static Task<GetProjectResult> InvokeAsync(GetProjectArgs args, InvokeOptions? opts = null)
public static Output<GetProjectResult> Invoke(GetProjectInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetProjectResult> getProject(GetProjectArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: gcp:organizations/getProject:getProject
Arguments:
# Arguments dictionary
The following arguments are supported:
- Project
Id string The project ID. If it is not provided, the provider project is used.
- Project
Id string The project ID. If it is not provided, the provider project is used.
- project
Id String The project ID. If it is not provided, the provider project is used.
- project
Id 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.
- project
Id String The project ID. If it is not provided, the provider project is used.
getProject Result
The following output properties are available:
- Auto
Create boolNetwork - Billing
Account string - Folder
Id string - Id string
The provider-assigned unique ID for this managed resource.
- Labels Dictionary<string, string>
- Name string
- Number string
The numeric identifier of the project.
- Org
Id string - Skip
Delete bool - Project
Id string
- Auto
Create boolNetwork - Billing
Account string - Folder
Id string - Id string
The provider-assigned unique ID for this managed resource.
- Labels map[string]string
- Name string
- Number string
The numeric identifier of the project.
- Org
Id string - Skip
Delete bool - Project
Id string
- auto
Create BooleanNetwork - billing
Account String - folder
Id String - id String
The provider-assigned unique ID for this managed resource.
- labels
Map
- name String
- number String
The numeric identifier of the project.
- org
Id String - skip
Delete Boolean - project
Id String
- auto
Create booleanNetwork - billing
Account string - folder
Id string - id string
The provider-assigned unique ID for this managed resource.
- labels {[key: string]: string}
- name string
- number string
The numeric identifier of the project.
- org
Id string - skip
Delete boolean - project
Id string
- auto_
create_ boolnetwork - 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
The numeric identifier of the project.
- org_
id str - skip_
delete bool - project_
id str
- auto
Create BooleanNetwork - billing
Account String - folder
Id String - id String
The provider-assigned unique ID for this managed resource.
- labels
Map
- name String
- number String
The numeric identifier of the project.
- org
Id String - skip
Delete Boolean - project
Id String
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.