1. Packages
  2. Zitadel
  3. API Docs
  4. getProjectRole
zitadel v0.2.0 published on Monday, Mar 24, 2025 by pulumiverse

zitadel.getProjectRole

Explore with Pulumi AI

zitadel v0.2.0 published on Monday, Mar 24, 2025 by pulumiverse

Datasource representing the project roles, which can be given as authorizations to users.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Zitadel = Pulumi.Zitadel;

return await Deployment.RunAsync(() => 
{
    var @default = Zitadel.GetProjectRole.Invoke(new()
    {
        OrgId = defaultZitadelOrg.Id,
        ProjectId = defaultZitadelProject.Id,
        RoleKey = "key",
    });

    return new Dictionary<string, object?>
    {
        ["projectRole"] = @default,
    };
});
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-zitadel/sdk/go/zitadel"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := zitadel.LookupProjectRole(ctx, &zitadel.LookupProjectRoleArgs{
			OrgId:     defaultZitadelOrg.Id,
			ProjectId: defaultZitadelProject.Id,
			RoleKey:   "key",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("projectRole", _default)
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zitadel.ZitadelFunctions;
import com.pulumi.zitadel.inputs.GetProjectRoleArgs;
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 default = ZitadelFunctions.getProjectRole(GetProjectRoleArgs.builder()
            .orgId(defaultZitadelOrg.id())
            .projectId(defaultZitadelProject.id())
            .roleKey("key")
            .build());

        ctx.export("projectRole", default_);
    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as zitadel from "@pulumi/zitadel";

const default = zitadel.getProjectRole({
    orgId: defaultZitadelOrg.id,
    projectId: defaultZitadelProject.id,
    roleKey: "key",
});
export const projectRole = _default;
Copy
import pulumi
import pulumi_zitadel as zitadel

default = zitadel.get_project_role(org_id=default_zitadel_org["id"],
    project_id=default_zitadel_project["id"],
    role_key="key")
pulumi.export("projectRole", default)
Copy
variables:
  default:
    fn::invoke:
      Function: zitadel:getProjectRole
      Arguments:
        orgId: ${defaultZitadelOrg.id}
        projectId: ${defaultZitadelProject.id}
        roleKey: key
outputs:
  projectRole: ${default}
Copy

Using getProjectRole

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 getProjectRole(args: GetProjectRoleArgs, opts?: InvokeOptions): Promise<GetProjectRoleResult>
function getProjectRoleOutput(args: GetProjectRoleOutputArgs, opts?: InvokeOptions): Output<GetProjectRoleResult>
Copy
def get_project_role(org_id: Optional[str] = None,
                     project_id: Optional[str] = None,
                     role_key: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetProjectRoleResult
def get_project_role_output(org_id: Optional[pulumi.Input[str]] = None,
                     project_id: Optional[pulumi.Input[str]] = None,
                     role_key: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetProjectRoleResult]
Copy
func LookupProjectRole(ctx *Context, args *LookupProjectRoleArgs, opts ...InvokeOption) (*LookupProjectRoleResult, error)
func LookupProjectRoleOutput(ctx *Context, args *LookupProjectRoleOutputArgs, opts ...InvokeOption) LookupProjectRoleResultOutput
Copy

> Note: This function is named LookupProjectRole in the Go SDK.

public static class GetProjectRole 
{
    public static Task<GetProjectRoleResult> InvokeAsync(GetProjectRoleArgs args, InvokeOptions? opts = null)
    public static Output<GetProjectRoleResult> Invoke(GetProjectRoleInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetProjectRoleResult> getProjectRole(GetProjectRoleArgs args, InvokeOptions options)
public static Output<GetProjectRoleResult> getProjectRole(GetProjectRoleArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: zitadel:index/getProjectRole:getProjectRole
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

OrgId This property is required. string
ID of the organization
ProjectId This property is required. string
ID of the project
RoleKey This property is required. string
Key used for project role
OrgId This property is required. string
ID of the organization
ProjectId This property is required. string
ID of the project
RoleKey This property is required. string
Key used for project role
orgId This property is required. String
ID of the organization
projectId This property is required. String
ID of the project
roleKey This property is required. String
Key used for project role
orgId This property is required. string
ID of the organization
projectId This property is required. string
ID of the project
roleKey This property is required. string
Key used for project role
org_id This property is required. str
ID of the organization
project_id This property is required. str
ID of the project
role_key This property is required. str
Key used for project role
orgId This property is required. String
ID of the organization
projectId This property is required. String
ID of the project
roleKey This property is required. String
Key used for project role

getProjectRole Result

The following output properties are available:

DisplayName string
Name used for project role
Group string
Group used for project role
Id string
The provider-assigned unique ID for this managed resource.
OrgId string
ID of the organization
ProjectId string
ID of the project
RoleKey string
Key used for project role
DisplayName string
Name used for project role
Group string
Group used for project role
Id string
The provider-assigned unique ID for this managed resource.
OrgId string
ID of the organization
ProjectId string
ID of the project
RoleKey string
Key used for project role
displayName String
Name used for project role
group String
Group used for project role
id String
The provider-assigned unique ID for this managed resource.
orgId String
ID of the organization
projectId String
ID of the project
roleKey String
Key used for project role
displayName string
Name used for project role
group string
Group used for project role
id string
The provider-assigned unique ID for this managed resource.
orgId string
ID of the organization
projectId string
ID of the project
roleKey string
Key used for project role
display_name str
Name used for project role
group str
Group used for project role
id str
The provider-assigned unique ID for this managed resource.
org_id str
ID of the organization
project_id str
ID of the project
role_key str
Key used for project role
displayName String
Name used for project role
group String
Group used for project role
id String
The provider-assigned unique ID for this managed resource.
orgId String
ID of the organization
projectId String
ID of the project
roleKey String
Key used for project role

Package Details

Repository
zitadel pulumiverse/pulumi-zitadel
License
Apache-2.0
Notes
This Pulumi package is based on the zitadel Terraform Provider.
zitadel v0.2.0 published on Monday, Mar 24, 2025 by pulumiverse