StrongDM v1.32.0 published on Monday, Oct 13, 2025 by Piers Karsenbarg
sdm.getGroupRole
A GroupRole assigns a Group to a Role.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as sdm from "@pierskarsenbarg/sdm";
const securityTeamRoles = sdm.getGroupRole({
groupId: sdm_group.security_team.id,
});
const specificRelationship = sdm.getGroupRole({
id: "grouprole-1234567890abcdef",
});
const groupsWithRole = sdm.getGroupRole({
roleId: sdm_role.admin_role.id,
});
import pulumi
import pulumi_sdm as sdm
security_team_roles = sdm.get_group_role(group_id=sdm_group["security_team"]["id"])
specific_relationship = sdm.get_group_role(id="grouprole-1234567890abcdef")
groups_with_role = sdm.get_group_role(role_id=sdm_role["admin_role"]["id"])
package main
import (
"github.com/pierskarsenbarg/pulumi-sdm/sdk/go/sdm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sdm.LookupGroupRole(ctx, &sdm.LookupGroupRoleArgs{
GroupId: pulumi.StringRef(sdm_group.Security_team.Id),
}, nil)
if err != nil {
return err
}
_, err = sdm.LookupGroupRole(ctx, &sdm.LookupGroupRoleArgs{
Id: pulumi.StringRef("grouprole-1234567890abcdef"),
}, nil)
if err != nil {
return err
}
_, err = sdm.LookupGroupRole(ctx, &sdm.LookupGroupRoleArgs{
RoleId: pulumi.StringRef(sdm_role.Admin_role.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sdm = Pulumi.Sdm;
return await Deployment.RunAsync(() =>
{
var securityTeamRoles = Sdm.GetGroupRole.Invoke(new()
{
GroupId = sdm_group.Security_team.Id,
});
var specificRelationship = Sdm.GetGroupRole.Invoke(new()
{
Id = "grouprole-1234567890abcdef",
});
var groupsWithRole = Sdm.GetGroupRole.Invoke(new()
{
RoleId = sdm_role.Admin_role.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sdm.SdmFunctions;
import com.pulumi.sdm.inputs.GetGroupRoleArgs;
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 securityTeamRoles = SdmFunctions.getGroupRole(GetGroupRoleArgs.builder()
.groupId(sdm_group.security_team().id())
.build());
final var specificRelationship = SdmFunctions.getGroupRole(GetGroupRoleArgs.builder()
.id("grouprole-1234567890abcdef")
.build());
final var groupsWithRole = SdmFunctions.getGroupRole(GetGroupRoleArgs.builder()
.roleId(sdm_role.admin_role().id())
.build());
}
}
variables:
securityTeamRoles:
fn::invoke:
function: sdm:getGroupRole
arguments:
groupId: ${sdm_group.security_team.id}
specificRelationship:
fn::invoke:
function: sdm:getGroupRole
arguments:
id: grouprole-1234567890abcdef
groupsWithRole:
fn::invoke:
function: sdm:getGroupRole
arguments:
roleId: ${sdm_role.admin_role.id}
Using getGroupRole
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 getGroupRole(args: GetGroupRoleArgs, opts?: InvokeOptions): Promise<GetGroupRoleResult>
function getGroupRoleOutput(args: GetGroupRoleOutputArgs, opts?: InvokeOptions): Output<GetGroupRoleResult>
def get_group_role(group_id: Optional[str] = None,
id: Optional[str] = None,
role_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetGroupRoleResult
def get_group_role_output(group_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
role_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetGroupRoleResult]
func LookupGroupRole(ctx *Context, args *LookupGroupRoleArgs, opts ...InvokeOption) (*LookupGroupRoleResult, error)
func LookupGroupRoleOutput(ctx *Context, args *LookupGroupRoleOutputArgs, opts ...InvokeOption) LookupGroupRoleResultOutput
> Note: This function is named LookupGroupRole
in the Go SDK.
public static class GetGroupRole
{
public static Task<GetGroupRoleResult> InvokeAsync(GetGroupRoleArgs args, InvokeOptions? opts = null)
public static Output<GetGroupRoleResult> Invoke(GetGroupRoleInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetGroupRoleResult> getGroupRole(GetGroupRoleArgs args, InvokeOptions options)
public static Output<GetGroupRoleResult> getGroupRole(GetGroupRoleArgs args, InvokeOptions options)
fn::invoke:
function: sdm:index/getGroupRole:getGroupRole
arguments:
# arguments dictionary
The following arguments are supported:
getGroupRole Result
The following output properties are available:
- Groups
Roles List<PiersKarsenbarg. Sdm. Outputs. Get Group Role Groups Role> - A list where each element has the following attributes:
- Ids List<string>
- a list of strings of ids of data sources that match the given arguments.
- Group
Id string - The assigned Group ID.
- Id string
- Unique identifier of the GroupRole.
- Role
Id string - The assigned Role ID.
- Groups
Roles []GetGroup Role Groups Role - A list where each element has the following attributes:
- Ids []string
- a list of strings of ids of data sources that match the given arguments.
- Group
Id string - The assigned Group ID.
- Id string
- Unique identifier of the GroupRole.
- Role
Id string - The assigned Role ID.
- groups
Roles List<GetGroup Role Groups Role> - A list where each element has the following attributes:
- ids List<String>
- a list of strings of ids of data sources that match the given arguments.
- group
Id String - The assigned Group ID.
- id String
- Unique identifier of the GroupRole.
- role
Id String - The assigned Role ID.
- groups
Roles GetGroup Role Groups Role[] - A list where each element has the following attributes:
- ids string[]
- a list of strings of ids of data sources that match the given arguments.
- group
Id string - The assigned Group ID.
- id string
- Unique identifier of the GroupRole.
- role
Id string - The assigned Role ID.
- groups_
roles Sequence[GetGroup Role Groups Role] - A list where each element has the following attributes:
- ids Sequence[str]
- a list of strings of ids of data sources that match the given arguments.
- group_
id str - The assigned Group ID.
- id str
- Unique identifier of the GroupRole.
- role_
id str - The assigned Role ID.
- groups
Roles List<Property Map> - A list where each element has the following attributes:
- ids List<String>
- a list of strings of ids of data sources that match the given arguments.
- group
Id String - The assigned Group ID.
- id String
- Unique identifier of the GroupRole.
- role
Id String - The assigned Role ID.
Supporting Types
GetGroupRoleGroupsRole
Package Details
- Repository
- sdm pierskarsenbarg/pulumi-sdm
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
sdm
Terraform Provider.