GitLab v8.11.0 published on Friday, Apr 18, 2025 by Pulumi
gitlab.getProjectIds
Explore with Pulumi AI
The gitlab.getProjectIds data source identification information for a given project, allowing a user to translate a full path or ID into the GraphQL ID of the project.
Upstream API: GitLab GraphQL API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const newProject = new gitlab.Project("new_project", {});
// use project IDs to get additional information, such as the GraphQL ID
// for other resources
const foo = gitlab.getProjectIds({
    project: "gitlab_project.new_project.id",
});
export const graphQLId = foo.then(foo => foo.projectGraphqlId);
import pulumi
import pulumi_gitlab as gitlab
new_project = gitlab.Project("new_project")
# use project IDs to get additional information, such as the GraphQL ID
# for other resources
foo = gitlab.get_project_ids(project="gitlab_project.new_project.id")
pulumi.export("graphQLId", foo.project_graphql_id)
package main
import (
	"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.NewProject(ctx, "new_project", nil)
		if err != nil {
			return err
		}
		// use project IDs to get additional information, such as the GraphQL ID
		// for other resources
		foo, err := gitlab.GetProjectIds(ctx, &gitlab.GetProjectIdsArgs{
			Project: "gitlab_project.new_project.id",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("graphQLId", foo.ProjectGraphqlId)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() => 
{
    var newProject = new GitLab.Project("new_project");
    // use project IDs to get additional information, such as the GraphQL ID
    // for other resources
    var foo = GitLab.GetProjectIds.Invoke(new()
    {
        Project = "gitlab_project.new_project.id",
    });
    return new Dictionary<string, object?>
    {
        ["graphQLId"] = foo.Apply(getProjectIdsResult => getProjectIdsResult.ProjectGraphqlId),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetProjectIdsArgs;
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) {
        var newProject = new Project("newProject");
        // use project IDs to get additional information, such as the GraphQL ID
        // for other resources
        final var foo = GitlabFunctions.getProjectIds(GetProjectIdsArgs.builder()
            .project("gitlab_project.new_project.id")
            .build());
        ctx.export("graphQLId", foo.projectGraphqlId());
    }
}
resources:
  newProject:
    type: gitlab:Project
    name: new_project
variables:
  # use project IDs to get additional information, such as the GraphQL ID
  # // for other resources
  foo:
    fn::invoke:
      function: gitlab:getProjectIds
      arguments:
        project: gitlab_project.new_project.id
outputs:
  graphQLId: ${foo.projectGraphqlId}
Using getProjectIds
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 getProjectIds(args: GetProjectIdsArgs, opts?: InvokeOptions): Promise<GetProjectIdsResult>
function getProjectIdsOutput(args: GetProjectIdsOutputArgs, opts?: InvokeOptions): Output<GetProjectIdsResult>def get_project_ids(project: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetProjectIdsResult
def get_project_ids_output(project: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetProjectIdsResult]func GetProjectIds(ctx *Context, args *GetProjectIdsArgs, opts ...InvokeOption) (*GetProjectIdsResult, error)
func GetProjectIdsOutput(ctx *Context, args *GetProjectIdsOutputArgs, opts ...InvokeOption) GetProjectIdsResultOutput> Note: This function is named GetProjectIds in the Go SDK.
public static class GetProjectIds 
{
    public static Task<GetProjectIdsResult> InvokeAsync(GetProjectIdsArgs args, InvokeOptions? opts = null)
    public static Output<GetProjectIdsResult> Invoke(GetProjectIdsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetProjectIdsResult> getProjectIds(GetProjectIdsArgs args, InvokeOptions options)
public static Output<GetProjectIdsResult> getProjectIds(GetProjectIdsArgs args, InvokeOptions options)
fn::invoke:
  function: gitlab:index/getProjectIds:getProjectIds
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Project string
 - The ID or URL-encoded path of the project.
 
- Project string
 - The ID or URL-encoded path of the project.
 
- project String
 - The ID or URL-encoded path of the project.
 
- project string
 - The ID or URL-encoded path of the project.
 
- project str
 - The ID or URL-encoded path of the project.
 
- project String
 - The ID or URL-encoded path of the project.
 
getProjectIds Result
The following output properties are available:
- Id string
 - Project string
 - The ID or URL-encoded path of the project.
 - Project
Full stringPath  - The full path of the project.
 - Project
Graphql stringId  - The GraphQL ID of the project.
 - Project
Id string - The ID of the project.
 
- Id string
 - Project string
 - The ID or URL-encoded path of the project.
 - Project
Full stringPath  - The full path of the project.
 - Project
Graphql stringId  - The GraphQL ID of the project.
 - Project
Id string - The ID of the project.
 
- id String
 - project String
 - The ID or URL-encoded path of the project.
 - project
Full StringPath  - The full path of the project.
 - project
Graphql StringId  - The GraphQL ID of the project.
 - project
Id String - The ID of the project.
 
- id string
 - project string
 - The ID or URL-encoded path of the project.
 - project
Full stringPath  - The full path of the project.
 - project
Graphql stringId  - The GraphQL ID of the project.
 - project
Id string - The ID of the project.
 
- id str
 - project str
 - The ID or URL-encoded path of the project.
 - project_
full_ strpath  - The full path of the project.
 - project_
graphql_ strid  - The GraphQL ID of the project.
 - project_
id str - The ID of the project.
 
- id String
 - project String
 - The ID or URL-encoded path of the project.
 - project
Full StringPath  - The full path of the project.
 - project
Graphql StringId  - The GraphQL ID of the project.
 - project
Id String - The ID of the project.
 
Package Details
- Repository
 - GitLab pulumi/pulumi-gitlab
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
gitlabTerraform Provider.