1. Packages
  2. Onelogin Provider
  3. API Docs
  4. Roles
onelogin 0.11.0 published on Friday, Aug 29, 2025 by onelogin

onelogin.Roles

Explore with Pulumi AI

onelogin logo
onelogin 0.11.0 published on Friday, Aug 29, 2025 by onelogin

    Manage Role resources in OneLogin.

    This resource allows you to create and configure Roles, including assigning applications, users, and administrators to roles.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as onelogin from "@pulumi/onelogin";
    
    const executiveAdmin = new onelogin.Roles("executiveAdmin", {
        admins: [777],
        apps: [
            123,
            456,
            787,
        ],
        users: [
            543,
            213,
            420,
        ],
    });
    
    import pulumi
    import pulumi_onelogin as onelogin
    
    executive_admin = onelogin.Roles("executiveAdmin",
        admins=[777],
        apps=[
            123,
            456,
            787,
        ],
        users=[
            543,
            213,
            420,
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/onelogin/onelogin"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := onelogin.NewRoles(ctx, "executiveAdmin", &onelogin.RolesArgs{
    			Admins: pulumi.Float64Array{
    				pulumi.Float64(777),
    			},
    			Apps: pulumi.Float64Array{
    				pulumi.Float64(123),
    				pulumi.Float64(456),
    				pulumi.Float64(787),
    			},
    			Users: pulumi.Float64Array{
    				pulumi.Float64(543),
    				pulumi.Float64(213),
    				pulumi.Float64(420),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Onelogin = Pulumi.Onelogin;
    
    return await Deployment.RunAsync(() => 
    {
        var executiveAdmin = new Onelogin.Roles("executiveAdmin", new()
        {
            Admins = new[]
            {
                777,
            },
            Apps = new[]
            {
                123,
                456,
                787,
            },
            Users = new[]
            {
                543,
                213,
                420,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.onelogin.Roles;
    import com.pulumi.onelogin.RolesArgs;
    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 executiveAdmin = new Roles("executiveAdmin", RolesArgs.builder()
                .admins(777)
                .apps(            
                    123,
                    456,
                    787)
                .users(            
                    543,
                    213,
                    420)
                .build());
    
        }
    }
    
    resources:
      executiveAdmin:
        type: onelogin:Roles
        properties:
          # Optional: assign administrators to this role
          admins:
            - 777
          # Optional: assign apps to this role
          apps:
            - 123
            - 456
            - 787
          # Optional: assign users to this role
          users:
            - 543
            - 213
            - 420
    

    Notes

    When updating a role, you must specify all fields you want to maintain. For example, if you want to add a new user to a role while keeping the existing users, you must include both the existing and new user IDs in the users attribute. Otherwise, the existing users will be removed from the role.

    Create Roles Resource

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

    Constructor syntax

    new Roles(name: string, args?: RolesArgs, opts?: CustomResourceOptions);
    @overload
    def Roles(resource_name: str,
              args: Optional[RolesArgs] = None,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Roles(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              admins: Optional[Sequence[float]] = None,
              apps: Optional[Sequence[float]] = None,
              name: Optional[str] = None,
              roles_id: Optional[str] = None,
              users: Optional[Sequence[float]] = None)
    func NewRoles(ctx *Context, name string, args *RolesArgs, opts ...ResourceOption) (*Roles, error)
    public Roles(string name, RolesArgs? args = null, CustomResourceOptions? opts = null)
    public Roles(String name, RolesArgs args)
    public Roles(String name, RolesArgs args, CustomResourceOptions options)
    
    type: onelogin:Roles
    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 RolesArgs
    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 RolesArgs
    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 RolesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RolesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RolesArgs
    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 rolesResource = new Onelogin.Roles("rolesResource", new()
    {
        Admins = new[]
        {
            0,
        },
        Apps = new[]
        {
            0,
        },
        Name = "string",
        RolesId = "string",
        Users = new[]
        {
            0,
        },
    });
    
    example, err := onelogin.NewRoles(ctx, "rolesResource", &onelogin.RolesArgs{
    	Admins: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	Apps: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    	Name:    pulumi.String("string"),
    	RolesId: pulumi.String("string"),
    	Users: pulumi.Float64Array{
    		pulumi.Float64(0),
    	},
    })
    
    var rolesResource = new Roles("rolesResource", RolesArgs.builder()
        .admins(0.0)
        .apps(0.0)
        .name("string")
        .rolesId("string")
        .users(0.0)
        .build());
    
    roles_resource = onelogin.Roles("rolesResource",
        admins=[0],
        apps=[0],
        name="string",
        roles_id="string",
        users=[0])
    
    const rolesResource = new onelogin.Roles("rolesResource", {
        admins: [0],
        apps: [0],
        name: "string",
        rolesId: "string",
        users: [0],
    });
    
    type: onelogin:Roles
    properties:
        admins:
            - 0
        apps:
            - 0
        name: string
        rolesId: string
        users:
            - 0
    

    Roles 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 Roles resource accepts the following input properties:

    Admins List<double>
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    Apps List<double>
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    Name string
    The name of the role.
    RolesId string
    The ID of the role.
    Users List<double>
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    Admins []float64
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    Apps []float64
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    Name string
    The name of the role.
    RolesId string
    The ID of the role.
    Users []float64
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    admins List<Double>
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    apps List<Double>
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    name String
    The name of the role.
    rolesId String
    The ID of the role.
    users List<Double>
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    admins number[]
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    apps number[]
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    name string
    The name of the role.
    rolesId string
    The ID of the role.
    users number[]
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    admins Sequence[float]
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    apps Sequence[float]
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    name str
    The name of the role.
    roles_id str
    The ID of the role.
    users Sequence[float]
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    admins List<Number>
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    apps List<Number>
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    name String
    The name of the role.
    rolesId String
    The ID of the role.
    users List<Number>
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Roles 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 Roles Resource

    Get an existing Roles 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?: RolesState, opts?: CustomResourceOptions): Roles
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            admins: Optional[Sequence[float]] = None,
            apps: Optional[Sequence[float]] = None,
            name: Optional[str] = None,
            roles_id: Optional[str] = None,
            users: Optional[Sequence[float]] = None) -> Roles
    func GetRoles(ctx *Context, name string, id IDInput, state *RolesState, opts ...ResourceOption) (*Roles, error)
    public static Roles Get(string name, Input<string> id, RolesState? state, CustomResourceOptions? opts = null)
    public static Roles get(String name, Output<String> id, RolesState state, CustomResourceOptions options)
    resources:  _:    type: onelogin:Roles    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:
    Admins List<double>
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    Apps List<double>
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    Name string
    The name of the role.
    RolesId string
    The ID of the role.
    Users List<double>
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    Admins []float64
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    Apps []float64
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    Name string
    The name of the role.
    RolesId string
    The ID of the role.
    Users []float64
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    admins List<Double>
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    apps List<Double>
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    name String
    The name of the role.
    rolesId String
    The ID of the role.
    users List<Double>
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    admins number[]
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    apps number[]
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    name string
    The name of the role.
    rolesId string
    The ID of the role.
    users number[]
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    admins Sequence[float]
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    apps Sequence[float]
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    name str
    The name of the role.
    roles_id str
    The ID of the role.
    users Sequence[float]
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.
    admins List<Number>
    A list of user IDs who will be administrators for this role. These users can manage the role settings. If not specified, no admins will be assigned to the role.
    apps List<Number>
    A list of app IDs to associate with this role. Users assigned to this role will have access to these applications. If not specified, no apps will be associated with the role.
    name String
    The name of the role.
    rolesId String
    The ID of the role.
    users List<Number>
    A list of user IDs to assign to this role. These users will gain access to any apps associated with this role. If not specified, no users will be assigned to the role.

    Import

    A role can be imported using the OneLogin Role ID.

    $ pulumi import onelogin:index/roles:Roles executive_admin <role id>
    

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

    Package Details

    Repository
    onelogin onelogin/terraform-provider-onelogin
    License
    Notes
    This Pulumi package is based on the onelogin Terraform Provider.
    onelogin logo
    onelogin 0.11.0 published on Friday, Aug 29, 2025 by onelogin