1. Packages
  2. Googleworkspace Provider
  3. API Docs
  4. getRole
googleworkspace 0.7.0 published on Wednesday, Jan 15, 2025 by hashicorp

googleworkspace.getRole

Explore with Pulumi AI

googleworkspace 0.7.0 published on Wednesday, Jan 15, 2025 by hashicorp

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as googleworkspace from "@pulumi/googleworkspace";

const group-admin = googleworkspace.getRole({
    name: "_GROUPS_ADMIN_ROLE",
});
export const isSystemRole = group_admin.then(group_admin => group_admin.isSystemRole);
Copy
import pulumi
import pulumi_googleworkspace as googleworkspace

group_admin = googleworkspace.get_role(name="_GROUPS_ADMIN_ROLE")
pulumi.export("isSystemRole", group_admin.is_system_role)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/googleworkspace/googleworkspace"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		group_admin, err := googleworkspace.LookupRole(ctx, &googleworkspace.LookupRoleArgs{
			Name: "_GROUPS_ADMIN_ROLE",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("isSystemRole", group_admin.IsSystemRole)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Googleworkspace = Pulumi.Googleworkspace;

return await Deployment.RunAsync(() => 
{
    var group_admin = Googleworkspace.GetRole.Invoke(new()
    {
        Name = "_GROUPS_ADMIN_ROLE",
    });

    return new Dictionary<string, object?>
    {
        ["isSystemRole"] = group_admin.Apply(group_admin => group_admin.Apply(getRoleResult => getRoleResult.IsSystemRole)),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.googleworkspace.GoogleworkspaceFunctions;
import com.pulumi.googleworkspace.inputs.GetRoleArgs;
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 group-admin = GoogleworkspaceFunctions.getRole(GetRoleArgs.builder()
            .name("_GROUPS_ADMIN_ROLE")
            .build());

        ctx.export("isSystemRole", group_admin.isSystemRole());
    }
}
Copy
variables:
  group-admin:
    fn::invoke:
      function: googleworkspace:getRole
      arguments:
        name: _GROUPS_ADMIN_ROLE
outputs:
  isSystemRole: ${["group-admin"].isSystemRole}
Copy

Using getRole

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 getRole(args: GetRoleArgs, opts?: InvokeOptions): Promise<GetRoleResult>
function getRoleOutput(args: GetRoleOutputArgs, opts?: InvokeOptions): Output<GetRoleResult>
Copy
def get_role(name: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetRoleResult
def get_role_output(name: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetRoleResult]
Copy
func LookupRole(ctx *Context, args *LookupRoleArgs, opts ...InvokeOption) (*LookupRoleResult, error)
func LookupRoleOutput(ctx *Context, args *LookupRoleOutputArgs, opts ...InvokeOption) LookupRoleResultOutput
Copy

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

public static class GetRole 
{
    public static Task<GetRoleResult> InvokeAsync(GetRoleArgs args, InvokeOptions? opts = null)
    public static Output<GetRoleResult> Invoke(GetRoleInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
public static Output<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: googleworkspace:index/getRole:getRole
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Name of the role.
Name This property is required. string
Name of the role.
name This property is required. String
Name of the role.
name This property is required. string
Name of the role.
name This property is required. str
Name of the role.
name This property is required. String
Name of the role.

getRole Result

The following output properties are available:

Description string
A short description of the role.
Etag string
ETag of the resource.
Id string
ID of the role.
IsSuperAdminRole bool
Returns true if the role is a super admin role.
IsSystemRole bool
Returns true if this is a pre-defined system role.
Name string
Name of the role.
Privileges List<GetRolePrivilege>
The set of privileges that are granted to this role.
Description string
A short description of the role.
Etag string
ETag of the resource.
Id string
ID of the role.
IsSuperAdminRole bool
Returns true if the role is a super admin role.
IsSystemRole bool
Returns true if this is a pre-defined system role.
Name string
Name of the role.
Privileges []GetRolePrivilege
The set of privileges that are granted to this role.
description String
A short description of the role.
etag String
ETag of the resource.
id String
ID of the role.
isSuperAdminRole Boolean
Returns true if the role is a super admin role.
isSystemRole Boolean
Returns true if this is a pre-defined system role.
name String
Name of the role.
privileges List<GetRolePrivilege>
The set of privileges that are granted to this role.
description string
A short description of the role.
etag string
ETag of the resource.
id string
ID of the role.
isSuperAdminRole boolean
Returns true if the role is a super admin role.
isSystemRole boolean
Returns true if this is a pre-defined system role.
name string
Name of the role.
privileges GetRolePrivilege[]
The set of privileges that are granted to this role.
description str
A short description of the role.
etag str
ETag of the resource.
id str
ID of the role.
is_super_admin_role bool
Returns true if the role is a super admin role.
is_system_role bool
Returns true if this is a pre-defined system role.
name str
Name of the role.
privileges Sequence[GetRolePrivilege]
The set of privileges that are granted to this role.
description String
A short description of the role.
etag String
ETag of the resource.
id String
ID of the role.
isSuperAdminRole Boolean
Returns true if the role is a super admin role.
isSystemRole Boolean
Returns true if this is a pre-defined system role.
name String
Name of the role.
privileges List<Property Map>
The set of privileges that are granted to this role.

Supporting Types

GetRolePrivilege

PrivilegeName This property is required. string
ServiceId This property is required. string
PrivilegeName This property is required. string
ServiceId This property is required. string
privilegeName This property is required. String
serviceId This property is required. String
privilegeName This property is required. string
serviceId This property is required. string
privilege_name This property is required. str
service_id This property is required. str
privilegeName This property is required. String
serviceId This property is required. String

Package Details

Repository
googleworkspace hashicorp/terraform-provider-googleworkspace
License
Notes
This Pulumi package is based on the googleworkspace Terraform Provider.
googleworkspace 0.7.0 published on Wednesday, Jan 15, 2025 by hashicorp