Viewing docs for Google Cloud v9.16.0
published on Thursday, Mar 19, 2026 by Pulumi
published on Thursday, Mar 19, 2026 by Pulumi
Viewing docs for Google Cloud v9.16.0
published on Thursday, Mar 19, 2026 by Pulumi
published on Thursday, Mar 19, 2026 by Pulumi
Retrieve the ancestors for a project. See the REST API for more details.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const example = gcp.projects.getAncestry({
project: "example-project",
});
import pulumi
import pulumi_gcp as gcp
example = gcp.projects.get_ancestry(project="example-project")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/projects"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := projects.GetAncestry(ctx, &projects.GetAncestryArgs{
Project: pulumi.StringRef("example-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 example = Gcp.Projects.GetAncestry.Invoke(new()
{
Project = "example-project",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.projects.ProjectsFunctions;
import com.pulumi.gcp.projects.inputs.GetAncestryArgs;
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 example = ProjectsFunctions.getAncestry(GetAncestryArgs.builder()
.project("example-project")
.build());
}
}
variables:
example:
fn::invoke:
function: gcp:projects:getAncestry
arguments:
project: example-project
Using getAncestry
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 getAncestry(args: GetAncestryArgs, opts?: InvokeOptions): Promise<GetAncestryResult>
function getAncestryOutput(args: GetAncestryOutputArgs, opts?: InvokeOptions): Output<GetAncestryResult>def get_ancestry(project: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAncestryResult
def get_ancestry_output(project: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAncestryResult]func GetAncestry(ctx *Context, args *GetAncestryArgs, opts ...InvokeOption) (*GetAncestryResult, error)
func GetAncestryOutput(ctx *Context, args *GetAncestryOutputArgs, opts ...InvokeOption) GetAncestryResultOutput> Note: This function is named GetAncestry in the Go SDK.
public static class GetAncestry
{
public static Task<GetAncestryResult> InvokeAsync(GetAncestryArgs args, InvokeOptions? opts = null)
public static Output<GetAncestryResult> Invoke(GetAncestryInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAncestryResult> getAncestry(GetAncestryArgs args, InvokeOptions options)
public static Output<GetAncestryResult> getAncestry(GetAncestryArgs args, InvokeOptions options)
fn::invoke:
function: gcp:projects/getAncestry:getAncestry
arguments:
# arguments dictionaryThe following arguments are supported:
- Project string
- The ID of the project. If it is not provided, the provider project is used.
- Project string
- The ID of the project. If it is not provided, the provider project is used.
- project String
- The ID of the project. If it is not provided, the provider project is used.
- project string
- The ID of the project. If it is not provided, the provider project is used.
- project str
- The ID of the project. If it is not provided, the provider project is used.
- project String
- The ID of the project. If it is not provided, the provider project is used.
getAncestry Result
The following output properties are available:
- Ancestors
List<Get
Ancestry Ancestor> - A list of the project's ancestors. Structure is defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Org
Id string - The organization id.
- Parent
Id string - The parent's id.
- Parent
Type string - One of
"folder"or"organization". - Project string
- Ancestors
[]Get
Ancestry Ancestor - A list of the project's ancestors. Structure is defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Org
Id string - The organization id.
- Parent
Id string - The parent's id.
- Parent
Type string - One of
"folder"or"organization". - Project string
- ancestors
List<Get
Ancestry Ancestor> - A list of the project's ancestors. Structure is defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- org
Id String - The organization id.
- parent
Id String - The parent's id.
- parent
Type String - One of
"folder"or"organization". - project String
- ancestors
Get
Ancestry Ancestor[] - A list of the project's ancestors. Structure is defined below.
- id string
- The provider-assigned unique ID for this managed resource.
- org
Id string - The organization id.
- parent
Id string - The parent's id.
- parent
Type string - One of
"folder"or"organization". - project string
- ancestors
Sequence[Get
Ancestry Ancestor] - A list of the project's ancestors. Structure is defined below.
- id str
- The provider-assigned unique ID for this managed resource.
- org_
id str - The organization id.
- parent_
id str - The parent's id.
- parent_
type str - One of
"folder"or"organization". - project str
- ancestors List<Property Map>
- A list of the project's ancestors. Structure is defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- org
Id String - The organization id.
- parent
Id String - The parent's id.
- parent
Type String - One of
"folder"or"organization". - project String
Supporting Types
GetAncestryAncestor
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.
Viewing docs for Google Cloud v9.16.0
published on Thursday, Mar 19, 2026 by Pulumi
published on Thursday, Mar 19, 2026 by Pulumi
