1. Packages
  2. StrongDM
  3. API Docs
  4. GroupRole
StrongDM v1.32.0 published on Monday, Oct 13, 2025 by Piers Karsenbarg

sdm.GroupRole

Deploy with Pulumi
sdm logo
StrongDM v1.32.0 published on Monday, Oct 13, 2025 by Piers Karsenbarg

    A GroupRole assigns a Group to a Role.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as sdm from "@pierskarsenbarg/sdm";
    
    const securityTeamToProductionAccess = new sdm.GroupRole("securityTeamToProductionAccess", {
        groupId: sdm_group.security_team.id,
        roleId: sdm_role.production_access.id,
    });
    const administratorsToAdminAccess = new sdm.GroupRole("administratorsToAdminAccess", {
        groupId: "group-1234567890abcdef",
        roleId: "r-1234567890abcdef",
    });
    
    import pulumi
    import pierskarsenbarg_pulumi_sdm as sdm
    
    security_team_to_production_access = sdm.GroupRole("securityTeamToProductionAccess",
        group_id=sdm_group["security_team"]["id"],
        role_id=sdm_role["production_access"]["id"])
    administrators_to_admin_access = sdm.GroupRole("administratorsToAdminAccess",
        group_id="group-1234567890abcdef",
        role_id="r-1234567890abcdef")
    
    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.NewGroupRole(ctx, "securityTeamToProductionAccess", &sdm.GroupRoleArgs{
    			GroupId: pulumi.Any(sdm_group.Security_team.Id),
    			RoleId:  pulumi.Any(sdm_role.Production_access.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = sdm.NewGroupRole(ctx, "administratorsToAdminAccess", &sdm.GroupRoleArgs{
    			GroupId: pulumi.String("group-1234567890abcdef"),
    			RoleId:  pulumi.String("r-1234567890abcdef"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Sdm = PiersKarsenbarg.Sdm;
    
    return await Deployment.RunAsync(() => 
    {
        var securityTeamToProductionAccess = new Sdm.GroupRole("securityTeamToProductionAccess", new()
        {
            GroupId = sdm_group.Security_team.Id,
            RoleId = sdm_role.Production_access.Id,
        });
    
        var administratorsToAdminAccess = new Sdm.GroupRole("administratorsToAdminAccess", new()
        {
            GroupId = "group-1234567890abcdef",
            RoleId = "r-1234567890abcdef",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sdm.GroupRole;
    import com.pulumi.sdm.GroupRoleArgs;
    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 securityTeamToProductionAccess = new GroupRole("securityTeamToProductionAccess", GroupRoleArgs.builder()
                .groupId(sdm_group.security_team().id())
                .roleId(sdm_role.production_access().id())
                .build());
    
            var administratorsToAdminAccess = new GroupRole("administratorsToAdminAccess", GroupRoleArgs.builder()
                .groupId("group-1234567890abcdef")
                .roleId("r-1234567890abcdef")
                .build());
    
        }
    }
    
    resources:
      securityTeamToProductionAccess:
        type: sdm:GroupRole
        properties:
          groupId: ${sdm_group.security_team.id}
          roleId: ${sdm_role.production_access.id}
      administratorsToAdminAccess:
        type: sdm:GroupRole
        properties:
          groupId: group-1234567890abcdef
          roleId: r-1234567890abcdef
    

    This resource can be imported using the import command.

    Create GroupRole Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GroupRole(name: string, args: GroupRoleArgs, opts?: CustomResourceOptions);
    @overload
    def GroupRole(resource_name: str,
                  args: GroupRoleArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def GroupRole(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  group_id: Optional[str] = None,
                  role_id: Optional[str] = None)
    func NewGroupRole(ctx *Context, name string, args GroupRoleArgs, opts ...ResourceOption) (*GroupRole, error)
    public GroupRole(string name, GroupRoleArgs args, CustomResourceOptions? opts = null)
    public GroupRole(String name, GroupRoleArgs args)
    public GroupRole(String name, GroupRoleArgs args, CustomResourceOptions options)
    
    type: sdm:GroupRole
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GroupRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GroupRoleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GroupRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GroupRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GroupRoleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var groupRoleResource = new Sdm.GroupRole("groupRoleResource", new()
    {
        GroupId = "string",
        RoleId = "string",
    });
    
    example, err := sdm.NewGroupRole(ctx, "groupRoleResource", &sdm.GroupRoleArgs{
    	GroupId: pulumi.String("string"),
    	RoleId:  pulumi.String("string"),
    })
    
    var groupRoleResource = new GroupRole("groupRoleResource", GroupRoleArgs.builder()
        .groupId("string")
        .roleId("string")
        .build());
    
    group_role_resource = sdm.GroupRole("groupRoleResource",
        group_id="string",
        role_id="string")
    
    const groupRoleResource = new sdm.GroupRole("groupRoleResource", {
        groupId: "string",
        roleId: "string",
    });
    
    type: sdm:GroupRole
    properties:
        groupId: string
        roleId: string
    

    GroupRole Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The GroupRole resource accepts the following input properties:

    GroupId string
    The assigned Group ID.
    RoleId string
    The assigned Role ID.
    GroupId string
    The assigned Group ID.
    RoleId string
    The assigned Role ID.
    groupId String
    The assigned Group ID.
    roleId String
    The assigned Role ID.
    groupId string
    The assigned Group ID.
    roleId string
    The assigned Role ID.
    group_id str
    The assigned Group ID.
    role_id str
    The assigned Role ID.
    groupId String
    The assigned Group ID.
    roleId String
    The assigned Role ID.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GroupRole resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing GroupRole Resource

    Get an existing GroupRole resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: GroupRoleState, opts?: CustomResourceOptions): GroupRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group_id: Optional[str] = None,
            role_id: Optional[str] = None) -> GroupRole
    func GetGroupRole(ctx *Context, name string, id IDInput, state *GroupRoleState, opts ...ResourceOption) (*GroupRole, error)
    public static GroupRole Get(string name, Input<string> id, GroupRoleState? state, CustomResourceOptions? opts = null)
    public static GroupRole get(String name, Output<String> id, GroupRoleState state, CustomResourceOptions options)
    resources:  _:    type: sdm:GroupRole    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    GroupId string
    The assigned Group ID.
    RoleId string
    The assigned Role ID.
    GroupId string
    The assigned Group ID.
    RoleId string
    The assigned Role ID.
    groupId String
    The assigned Group ID.
    roleId String
    The assigned Role ID.
    groupId string
    The assigned Group ID.
    roleId string
    The assigned Role ID.
    group_id str
    The assigned Group ID.
    role_id str
    The assigned Role ID.
    groupId String
    The assigned Group ID.
    roleId String
    The assigned Role ID.

    Import

    A GroupRole can be imported using the id, e.g.,

    $ pulumi import sdm:index/groupRole:GroupRole example grouprole-12345678
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    sdm pierskarsenbarg/pulumi-sdm
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the sdm Terraform Provider.
    sdm logo
    StrongDM v1.32.0 published on Monday, Oct 13, 2025 by Piers Karsenbarg
      Meet Neo: Your AI Platform Teammate