published on Friday, Aug 14, 2026 by onelogin
published on Friday, Aug 14, 2026 by onelogin
Returns User IDs matching the given attributes.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as onelogin from "@pulumi/onelogin";
const example = onelogin.getUsers({
firstname: "tom",
});
import pulumi
import pulumi_onelogin as onelogin
example = onelogin.get_users(firstname="tom")
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.LookupUsers(ctx, &onelogin.LookupUsersArgs{
Firstname: pulumi.StringRef("tom"),
}, nil)
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 example = Onelogin.GetUsers.Invoke(new()
{
Firstname = "tom",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.onelogin.OneloginFunctions;
import com.pulumi.onelogin.inputs.GetUsersArgs;
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 example = OneloginFunctions.getUsers(GetUsersArgs.builder()
.firstname("tom")
.build());
}
}
variables:
example:
fn::invoke:
function: onelogin:getUsers
arguments:
firstname: tom
Example coming soon!
Looking users up by email
Resources that take user IDs — onelogin_roles.users among them — can be given
the results of a lookup rather than IDs written out by hand. emails takes a
list, so a whole membership can come from one data source:
import * as pulumi from "@pulumi/pulumi";
import * as onelogin from "@pulumi/onelogin";
const engineering = onelogin.getUsers({
emails: [
"alice@example.com",
"bob@example.com",
],
});
const engineeringRoles = new onelogin.Roles("engineering", {
name: "Engineering",
users: engineering.then(engineering => engineering.users.map(__item => __item.id)),
});
import pulumi
import pulumi_onelogin as onelogin
engineering = onelogin.get_users(emails=[
"alice@example.com",
"bob@example.com",
])
engineering_roles = onelogin.Roles("engineering",
name="Engineering",
users=[__item.id for __item in engineering.users])
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 {
engineering, err := onelogin.LookupUsers(ctx, &onelogin.LookupUsersArgs{
Emails: []string{
"alice@example.com",
"bob@example.com",
},
}, nil)
if err != nil {
return err
}
var splat0 []*float64
for _, val0 := range engineering.Users {
splat0 = append(splat0, val0.Id)
}
_, err = onelogin.NewRoles(ctx, "engineering", &onelogin.RolesArgs{
Name: pulumi.String("Engineering"),
Users: splat0,
})
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 engineering = Onelogin.GetUsers.Invoke(new()
{
Emails = new[]
{
"alice@example.com",
"bob@example.com",
},
});
var engineeringRoles = new Onelogin.Roles("engineering", new()
{
Name = "Engineering",
Users = engineering.Apply(getUsersResult => getUsersResult.Users).Select(__item => __item.Id).ToList(),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.onelogin.OneloginFunctions;
import com.pulumi.onelogin.inputs.GetUsersArgs;
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) {
final var engineering = OneloginFunctions.getUsers(GetUsersArgs.builder()
.emails(
"alice@example.com",
"bob@example.com")
.build());
var engineeringRoles = new Roles("engineeringRoles", RolesArgs.builder()
.name("Engineering")
.users(engineering.users().stream().map(element -> element.id()).collect(toList()))
.build());
}
}
Example coming soon!
Example coming soon!
users[*].id is already a list of numbers, so it can be passed straight through;
ids holds the same values as strings.
Note that an email matching no user contributes nothing rather than failing. If a typo would be better caught than ignored, compare the counts:
Using getUsers
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 getUsers(args: GetUsersArgs, opts?: InvokeOptions): Promise<GetUsersResult>
function getUsersOutput(args: GetUsersOutputArgs, opts?: InvokeOutputOptions): Output<GetUsersResult>def get_users(directory_id: Optional[float] = None,
email: Optional[str] = None,
emails: Optional[Sequence[str]] = None,
external_id: Optional[float] = None,
firstname: Optional[str] = None,
id: Optional[str] = None,
lastname: Optional[str] = None,
samaccountname: Optional[str] = None,
user_id: Optional[str] = None,
username: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetUsersResult
def get_users_output(directory_id: pulumi.Input[Optional[float]] = None,
email: pulumi.Input[Optional[str]] = None,
emails: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
external_id: pulumi.Input[Optional[float]] = None,
firstname: pulumi.Input[Optional[str]] = None,
id: pulumi.Input[Optional[str]] = None,
lastname: pulumi.Input[Optional[str]] = None,
samaccountname: pulumi.Input[Optional[str]] = None,
user_id: pulumi.Input[Optional[str]] = None,
username: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetUsersResult]func LookupUsers(ctx *Context, args *LookupUsersArgs, opts ...InvokeOption) (*LookupUsersResult, error)
func LookupUsersOutput(ctx *Context, args *LookupUsersOutputArgs, opts ...InvokeOption) LookupUsersResultOutput> Note: This function is named LookupUsers in the Go SDK.
public static class GetUsers
{
public static Task<GetUsersResult> InvokeAsync(GetUsersArgs args, InvokeOptions? opts = null)
public static Output<GetUsersResult> Invoke(GetUsersInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetUsersResult> Invoke(GetUsersInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetUsersResult> getUsers(GetUsersArgs args, InvokeOptions options)
public static Output<GetUsersResult> getUsers(GetUsersArgs args, InvokeOptions options)
public static Output<GetUsersResult> getUsers(GetUsersArgs args, InvokeOutputOptions options)
fn::invoke:
function: onelogin:index/getUsers:getUsers
arguments:
# arguments dictionarydata "onelogin_get_users" "name" {
# arguments
}The following arguments are supported:
- Directory
Id double - The user's directory_id
- Email string
- The user's email.
- Emails List<string>
- A list of emails to look up at once. The API matches one email per
request, so each is queried in turn and the results combined, in the order
given, with duplicates removed. Any other argument set here applies to every
one of those queries. Conflicts with
email. - External
Id double - The user's external_id
- Firstname string
- The user's first name
- Id string
- Lastname string
- The user's last name
- Samaccountname string
- The user's samaccount name
- User
Id string - Username string
- The user's username.
- Directory
Id float64 - The user's directory_id
- Email string
- The user's email.
- Emails []string
- A list of emails to look up at once. The API matches one email per
request, so each is queried in turn and the results combined, in the order
given, with duplicates removed. Any other argument set here applies to every
one of those queries. Conflicts with
email. - External
Id float64 - The user's external_id
- Firstname string
- The user's first name
- Id string
- Lastname string
- The user's last name
- Samaccountname string
- The user's samaccount name
- User
Id string - Username string
- The user's username.
- directory_
id number - The user's directory_id
- email string
- The user's email.
- emails list(string)
- A list of emails to look up at once. The API matches one email per
request, so each is queried in turn and the results combined, in the order
given, with duplicates removed. Any other argument set here applies to every
one of those queries. Conflicts with
email. - external_
id number - The user's external_id
- firstname string
- The user's first name
- id string
- lastname string
- The user's last name
- samaccountname string
- The user's samaccount name
- user_
id string - username string
- The user's username.
- directory
Id Double - The user's directory_id
- email String
- The user's email.
- emails List<String>
- A list of emails to look up at once. The API matches one email per
request, so each is queried in turn and the results combined, in the order
given, with duplicates removed. Any other argument set here applies to every
one of those queries. Conflicts with
email. - external
Id Double - The user's external_id
- firstname String
- The user's first name
- id String
- lastname String
- The user's last name
- samaccountname String
- The user's samaccount name
- user
Id String - username String
- The user's username.
- directory
Id number - The user's directory_id
- email string
- The user's email.
- emails string[]
- A list of emails to look up at once. The API matches one email per
request, so each is queried in turn and the results combined, in the order
given, with duplicates removed. Any other argument set here applies to every
one of those queries. Conflicts with
email. - external
Id number - The user's external_id
- firstname string
- The user's first name
- id string
- lastname string
- The user's last name
- samaccountname string
- The user's samaccount name
- user
Id string - username string
- The user's username.
- directory_
id float - The user's directory_id
- email str
- The user's email.
- emails Sequence[str]
- A list of emails to look up at once. The API matches one email per
request, so each is queried in turn and the results combined, in the order
given, with duplicates removed. Any other argument set here applies to every
one of those queries. Conflicts with
email. - external_
id float - The user's external_id
- firstname str
- The user's first name
- id str
- lastname str
- The user's last name
- samaccountname str
- The user's samaccount name
- user_
id str - username str
- The user's username.
- directory
Id Number - The user's directory_id
- email String
- The user's email.
- emails List<String>
- A list of emails to look up at once. The API matches one email per
request, so each is queried in turn and the results combined, in the order
given, with duplicates removed. Any other argument set here applies to every
one of those queries. Conflicts with
email. - external
Id Number - The user's external_id
- firstname String
- The user's first name
- id String
- lastname String
- The user's last name
- samaccountname String
- The user's samaccount name
- user
Id String - username String
- The user's username.
getUsers Result
The following output properties are available:
- Id string
- Ids List<string>
- List of user's id, as strings
- Users
List<Get
Users User> - List of the matching users, each with
id(number),username,email,firstname,lastname,samaccountname,external_id,directory_idandlast_login - Directory
Id double - Email string
- Emails List<string>
- External
Id double - Firstname string
- Lastname string
- Samaccountname string
- User
Id string - Username string
- Id string
- Ids []string
- List of user's id, as strings
- Users
[]Get
Users User - List of the matching users, each with
id(number),username,email,firstname,lastname,samaccountname,external_id,directory_idandlast_login - Directory
Id float64 - Email string
- Emails []string
- External
Id float64 - Firstname string
- Lastname string
- Samaccountname string
- User
Id string - Username string
- id string
- ids list(string)
- List of user's id, as strings
- users list(object)
- List of the matching users, each with
id(number),username,email,firstname,lastname,samaccountname,external_id,directory_idandlast_login - directory_
id number - email string
- emails list(string)
- external_
id number - firstname string
- lastname string
- samaccountname string
- user_
id string - username string
- id String
- ids List<String>
- List of user's id, as strings
- users
List<Get
Users User> - List of the matching users, each with
id(number),username,email,firstname,lastname,samaccountname,external_id,directory_idandlast_login - directory
Id Double - email String
- emails List<String>
- external
Id Double - firstname String
- lastname String
- samaccountname String
- user
Id String - username String
- id string
- ids string[]
- List of user's id, as strings
- users
Get
Users User[] - List of the matching users, each with
id(number),username,email,firstname,lastname,samaccountname,external_id,directory_idandlast_login - directory
Id number - email string
- emails string[]
- external
Id number - firstname string
- lastname string
- samaccountname string
- user
Id string - username string
- id str
- ids Sequence[str]
- List of user's id, as strings
- users
Sequence[Get
Users User] - List of the matching users, each with
id(number),username,email,firstname,lastname,samaccountname,external_id,directory_idandlast_login - directory_
id float - email str
- emails Sequence[str]
- external_
id float - firstname str
- lastname str
- samaccountname str
- user_
id str - username str
- id String
- ids List<String>
- List of user's id, as strings
- users List<Property Map>
- List of the matching users, each with
id(number),username,email,firstname,lastname,samaccountname,external_id,directory_idandlast_login - directory
Id Number - email String
- emails List<String>
- external
Id Number - firstname String
- lastname String
- samaccountname String
- user
Id String - username String
Supporting Types
GetUsersUser
- Directory
Id double - The user's directory_id
- Email string
- The user's email.
- External
Id double - The user's external_id
- Firstname string
- The user's first name
- Id double
- Last
Login string - Lastname string
- The user's last name
- Samaccountname string
- The user's samaccount name
- Username string
- The user's username.
- Directory
Id float64 - The user's directory_id
- Email string
- The user's email.
- External
Id float64 - The user's external_id
- Firstname string
- The user's first name
- Id float64
- Last
Login string - Lastname string
- The user's last name
- Samaccountname string
- The user's samaccount name
- Username string
- The user's username.
- directory_
id number - The user's directory_id
- email string
- The user's email.
- external_
id number - The user's external_id
- firstname string
- The user's first name
- id number
- last_
login string - lastname string
- The user's last name
- samaccountname string
- The user's samaccount name
- username string
- The user's username.
- directory
Id Double - The user's directory_id
- email String
- The user's email.
- external
Id Double - The user's external_id
- firstname String
- The user's first name
- id Double
- last
Login String - lastname String
- The user's last name
- samaccountname String
- The user's samaccount name
- username String
- The user's username.
- directory
Id number - The user's directory_id
- email string
- The user's email.
- external
Id number - The user's external_id
- firstname string
- The user's first name
- id number
- last
Login string - lastname string
- The user's last name
- samaccountname string
- The user's samaccount name
- username string
- The user's username.
- directory_
id float - The user's directory_id
- email str
- The user's email.
- external_
id float - The user's external_id
- firstname str
- The user's first name
- id float
- last_
login str - lastname str
- The user's last name
- samaccountname str
- The user's samaccount name
- username str
- The user's username.
- directory
Id Number - The user's directory_id
- email String
- The user's email.
- external
Id Number - The user's external_id
- firstname String
- The user's first name
- id Number
- last
Login String - lastname String
- The user's last name
- samaccountname String
- The user's samaccount name
- username String
- The user's username.
Package Details
- Repository
- onelogin onelogin/terraform-provider-onelogin
- License
- Notes
- This Pulumi package is based on the
oneloginTerraform Provider.
published on Friday, Aug 14, 2026 by onelogin