1. Packages
  2. Okta
  3. API Docs
  4. user
  5. getUser
Okta v4.8.1 published on Thursday, Apr 18, 2024 by Pulumi

okta.user.getUser

Explore with Pulumi AI

okta logo
Okta v4.8.1 published on Thursday, Apr 18, 2024 by Pulumi

    Use this data source to retrieve a users from Okta.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const example = okta.user.getUser({
        searches: [{
            expression: "profile.firstName eq \"John\"",
        }],
    });
    
    import pulumi
    import pulumi_okta as okta
    
    example = okta.user.get_user(searches=[okta.user.GetUserSearchArgs(
        expression="profile.firstName eq \"John\"",
    )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v4/go/okta/user"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := user.LookupUser(ctx, &user.LookupUserArgs{
    			Searches: []user.GetUserSearch{
    				{
    					Expression: pulumi.StringRef("profile.firstName eq \"John\""),
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Okta.User.GetUser.Invoke(new()
        {
            Searches = new[]
            {
                new Okta.User.Inputs.GetUserSearchInputArgs
                {
                    Expression = "profile.firstName eq \"John\"",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.user.UserFunctions;
    import com.pulumi.okta.user.inputs.GetUserArgs;
    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 = UserFunctions.getUser(GetUserArgs.builder()
                .searches(GetUserSearchArgs.builder()
                    .expression("profile.firstName eq \"John\"")
                    .build())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: okta:user:getUser
          Arguments:
            searches:
              - expression: profile.firstName eq "John"
    

    Using getUser

    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 getUser(args: GetUserArgs, opts?: InvokeOptions): Promise<GetUserResult>
    function getUserOutput(args: GetUserOutputArgs, opts?: InvokeOptions): Output<GetUserResult>
    def get_user(compound_search_operator: Optional[str] = None,
                 delay_read_seconds: Optional[str] = None,
                 searches: Optional[Sequence[GetUserSearch]] = None,
                 skip_groups: Optional[bool] = None,
                 skip_roles: Optional[bool] = None,
                 user_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetUserResult
    def get_user_output(compound_search_operator: Optional[pulumi.Input[str]] = None,
                 delay_read_seconds: Optional[pulumi.Input[str]] = None,
                 searches: Optional[pulumi.Input[Sequence[pulumi.Input[GetUserSearchArgs]]]] = None,
                 skip_groups: Optional[pulumi.Input[bool]] = None,
                 skip_roles: Optional[pulumi.Input[bool]] = None,
                 user_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetUserResult]
    func LookupUser(ctx *Context, args *LookupUserArgs, opts ...InvokeOption) (*LookupUserResult, error)
    func LookupUserOutput(ctx *Context, args *LookupUserOutputArgs, opts ...InvokeOption) LookupUserResultOutput

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

    public static class GetUser 
    {
        public static Task<GetUserResult> InvokeAsync(GetUserArgs args, InvokeOptions? opts = null)
        public static Output<GetUserResult> Invoke(GetUserInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserResult> getUser(GetUserArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: okta:user/getUser:getUser
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompoundSearchOperator string
    Given multiple search elements they will be compounded together with the op. Default is and, or is also valid.
    DelayReadSeconds string
    Force delay of the user read by N seconds. Useful when eventual consistency of user information needs to be allowed for.
    Searches List<GetUserSearch>
    Map of search criteria. It supports the following properties.
    SkipGroups bool
    SkipRoles bool
    UserId string
    String representing a specific user's id value
    CompoundSearchOperator string
    Given multiple search elements they will be compounded together with the op. Default is and, or is also valid.
    DelayReadSeconds string
    Force delay of the user read by N seconds. Useful when eventual consistency of user information needs to be allowed for.
    Searches []GetUserSearch
    Map of search criteria. It supports the following properties.
    SkipGroups bool
    SkipRoles bool
    UserId string
    String representing a specific user's id value
    compoundSearchOperator String
    Given multiple search elements they will be compounded together with the op. Default is and, or is also valid.
    delayReadSeconds String
    Force delay of the user read by N seconds. Useful when eventual consistency of user information needs to be allowed for.
    searches List<GetUserSearch>
    Map of search criteria. It supports the following properties.
    skipGroups Boolean
    skipRoles Boolean
    userId String
    String representing a specific user's id value
    compoundSearchOperator string
    Given multiple search elements they will be compounded together with the op. Default is and, or is also valid.
    delayReadSeconds string
    Force delay of the user read by N seconds. Useful when eventual consistency of user information needs to be allowed for.
    searches GetUserSearch[]
    Map of search criteria. It supports the following properties.
    skipGroups boolean
    skipRoles boolean
    userId string
    String representing a specific user's id value
    compound_search_operator str
    Given multiple search elements they will be compounded together with the op. Default is and, or is also valid.
    delay_read_seconds str
    Force delay of the user read by N seconds. Useful when eventual consistency of user information needs to be allowed for.
    searches Sequence[GetUserSearch]
    Map of search criteria. It supports the following properties.
    skip_groups bool
    skip_roles bool
    user_id str
    String representing a specific user's id value
    compoundSearchOperator String
    Given multiple search elements they will be compounded together with the op. Default is and, or is also valid.
    delayReadSeconds String
    Force delay of the user read by N seconds. Useful when eventual consistency of user information needs to be allowed for.
    searches List<Property Map>
    Map of search criteria. It supports the following properties.
    skipGroups Boolean
    skipRoles Boolean
    userId String
    String representing a specific user's id value

    getUser Result

    The following output properties are available:

    AdminRoles List<string>
    City string
    City or locality component of user's address.
    CostCenter string
    Name of a cost center assigned to user.
    CountryCode string
    Country name component of user's address.
    CustomProfileAttributes string
    Raw JSON containing all custom profile attributes.
    Department string
    Name of user's department.
    DisplayName string
    Name of the user, suitable for display to end users.
    Division string
    Name of user's division.
    Email string
    Primary email address of user.
    EmployeeNumber string
    Organization or company assigned unique identifier for the user.
    FirstName string
    Given name of the user.
    GroupMemberships List<string>
    HonorificPrefix string
    Honorific prefix(es) of the user, or title in most Western languages.
    HonorificSuffix string
    Honorific suffix(es) of the user.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastName string
    Family name of the user.
    Locale string
    User's default location for purposes of localizing items such as currency, date time format, numerical representations, etc.
    Login string
    Unique identifier for the user.
    Manager string
    Display name of the user's manager.
    ManagerId string
    id of a user's manager.
    MiddleName string
    Middle name(s) of the user.
    MobilePhone string
    Mobile phone number of user.
    NickName string
    Casual way to address the user in real life.
    Organization string
    Name of user's organization.
    PostalAddress string
    Mailing address component of user's address.
    PreferredLanguage string
    User's preferred written or spoken languages.
    PrimaryPhone string
    Primary phone number of user such as home number.
    ProfileUrl string
    URL of user's online profile (e.g. a web page).
    Roles List<string>
    All roles assigned to user.
    SecondEmail string
    Secondary email address of user typically used for account recovery.
    State string
    State or region component of user's address (region).
    Status string
    Current status of user.
    StreetAddress string
    Full street address component of user's address.
    Timezone string
    User's time zone.
    Title string
    User's title, such as "Vice President".
    UserType string
    Used to describe the organization to user relationship such as "Employee" or "Contractor".
    ZipCode string
    Zipcode or postal code component of user's address (postalCode)
    CompoundSearchOperator string
    DelayReadSeconds string
    Searches List<GetUserSearch>
    SkipGroups bool
    SkipRoles bool
    UserId string
    AdminRoles []string
    City string
    City or locality component of user's address.
    CostCenter string
    Name of a cost center assigned to user.
    CountryCode string
    Country name component of user's address.
    CustomProfileAttributes string
    Raw JSON containing all custom profile attributes.
    Department string
    Name of user's department.
    DisplayName string
    Name of the user, suitable for display to end users.
    Division string
    Name of user's division.
    Email string
    Primary email address of user.
    EmployeeNumber string
    Organization or company assigned unique identifier for the user.
    FirstName string
    Given name of the user.
    GroupMemberships []string
    HonorificPrefix string
    Honorific prefix(es) of the user, or title in most Western languages.
    HonorificSuffix string
    Honorific suffix(es) of the user.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastName string
    Family name of the user.
    Locale string
    User's default location for purposes of localizing items such as currency, date time format, numerical representations, etc.
    Login string
    Unique identifier for the user.
    Manager string
    Display name of the user's manager.
    ManagerId string
    id of a user's manager.
    MiddleName string
    Middle name(s) of the user.
    MobilePhone string
    Mobile phone number of user.
    NickName string
    Casual way to address the user in real life.
    Organization string
    Name of user's organization.
    PostalAddress string
    Mailing address component of user's address.
    PreferredLanguage string
    User's preferred written or spoken languages.
    PrimaryPhone string
    Primary phone number of user such as home number.
    ProfileUrl string
    URL of user's online profile (e.g. a web page).
    Roles []string
    All roles assigned to user.
    SecondEmail string
    Secondary email address of user typically used for account recovery.
    State string
    State or region component of user's address (region).
    Status string
    Current status of user.
    StreetAddress string
    Full street address component of user's address.
    Timezone string
    User's time zone.
    Title string
    User's title, such as "Vice President".
    UserType string
    Used to describe the organization to user relationship such as "Employee" or "Contractor".
    ZipCode string
    Zipcode or postal code component of user's address (postalCode)
    CompoundSearchOperator string
    DelayReadSeconds string
    Searches []GetUserSearch
    SkipGroups bool
    SkipRoles bool
    UserId string
    adminRoles List<String>
    city String
    City or locality component of user's address.
    costCenter String
    Name of a cost center assigned to user.
    countryCode String
    Country name component of user's address.
    customProfileAttributes String
    Raw JSON containing all custom profile attributes.
    department String
    Name of user's department.
    displayName String
    Name of the user, suitable for display to end users.
    division String
    Name of user's division.
    email String
    Primary email address of user.
    employeeNumber String
    Organization or company assigned unique identifier for the user.
    firstName String
    Given name of the user.
    groupMemberships List<String>
    honorificPrefix String
    Honorific prefix(es) of the user, or title in most Western languages.
    honorificSuffix String
    Honorific suffix(es) of the user.
    id String
    The provider-assigned unique ID for this managed resource.
    lastName String
    Family name of the user.
    locale String
    User's default location for purposes of localizing items such as currency, date time format, numerical representations, etc.
    login String
    Unique identifier for the user.
    manager String
    Display name of the user's manager.
    managerId String
    id of a user's manager.
    middleName String
    Middle name(s) of the user.
    mobilePhone String
    Mobile phone number of user.
    nickName String
    Casual way to address the user in real life.
    organization String
    Name of user's organization.
    postalAddress String
    Mailing address component of user's address.
    preferredLanguage String
    User's preferred written or spoken languages.
    primaryPhone String
    Primary phone number of user such as home number.
    profileUrl String
    URL of user's online profile (e.g. a web page).
    roles List<String>
    All roles assigned to user.
    secondEmail String
    Secondary email address of user typically used for account recovery.
    state String
    State or region component of user's address (region).
    status String
    Current status of user.
    streetAddress String
    Full street address component of user's address.
    timezone String
    User's time zone.
    title String
    User's title, such as "Vice President".
    userType String
    Used to describe the organization to user relationship such as "Employee" or "Contractor".
    zipCode String
    Zipcode or postal code component of user's address (postalCode)
    compoundSearchOperator String
    delayReadSeconds String
    searches List<GetUserSearch>
    skipGroups Boolean
    skipRoles Boolean
    userId String
    adminRoles string[]
    city string
    City or locality component of user's address.
    costCenter string
    Name of a cost center assigned to user.
    countryCode string
    Country name component of user's address.
    customProfileAttributes string
    Raw JSON containing all custom profile attributes.
    department string
    Name of user's department.
    displayName string
    Name of the user, suitable for display to end users.
    division string
    Name of user's division.
    email string
    Primary email address of user.
    employeeNumber string
    Organization or company assigned unique identifier for the user.
    firstName string
    Given name of the user.
    groupMemberships string[]
    honorificPrefix string
    Honorific prefix(es) of the user, or title in most Western languages.
    honorificSuffix string
    Honorific suffix(es) of the user.
    id string
    The provider-assigned unique ID for this managed resource.
    lastName string
    Family name of the user.
    locale string
    User's default location for purposes of localizing items such as currency, date time format, numerical representations, etc.
    login string
    Unique identifier for the user.
    manager string
    Display name of the user's manager.
    managerId string
    id of a user's manager.
    middleName string
    Middle name(s) of the user.
    mobilePhone string
    Mobile phone number of user.
    nickName string
    Casual way to address the user in real life.
    organization string
    Name of user's organization.
    postalAddress string
    Mailing address component of user's address.
    preferredLanguage string
    User's preferred written or spoken languages.
    primaryPhone string
    Primary phone number of user such as home number.
    profileUrl string
    URL of user's online profile (e.g. a web page).
    roles string[]
    All roles assigned to user.
    secondEmail string
    Secondary email address of user typically used for account recovery.
    state string
    State or region component of user's address (region).
    status string
    Current status of user.
    streetAddress string
    Full street address component of user's address.
    timezone string
    User's time zone.
    title string
    User's title, such as "Vice President".
    userType string
    Used to describe the organization to user relationship such as "Employee" or "Contractor".
    zipCode string
    Zipcode or postal code component of user's address (postalCode)
    compoundSearchOperator string
    delayReadSeconds string
    searches GetUserSearch[]
    skipGroups boolean
    skipRoles boolean
    userId string
    admin_roles Sequence[str]
    city str
    City or locality component of user's address.
    cost_center str
    Name of a cost center assigned to user.
    country_code str
    Country name component of user's address.
    custom_profile_attributes str
    Raw JSON containing all custom profile attributes.
    department str
    Name of user's department.
    display_name str
    Name of the user, suitable for display to end users.
    division str
    Name of user's division.
    email str
    Primary email address of user.
    employee_number str
    Organization or company assigned unique identifier for the user.
    first_name str
    Given name of the user.
    group_memberships Sequence[str]
    honorific_prefix str
    Honorific prefix(es) of the user, or title in most Western languages.
    honorific_suffix str
    Honorific suffix(es) of the user.
    id str
    The provider-assigned unique ID for this managed resource.
    last_name str
    Family name of the user.
    locale str
    User's default location for purposes of localizing items such as currency, date time format, numerical representations, etc.
    login str
    Unique identifier for the user.
    manager str
    Display name of the user's manager.
    manager_id str
    id of a user's manager.
    middle_name str
    Middle name(s) of the user.
    mobile_phone str
    Mobile phone number of user.
    nick_name str
    Casual way to address the user in real life.
    organization str
    Name of user's organization.
    postal_address str
    Mailing address component of user's address.
    preferred_language str
    User's preferred written or spoken languages.
    primary_phone str
    Primary phone number of user such as home number.
    profile_url str
    URL of user's online profile (e.g. a web page).
    roles Sequence[str]
    All roles assigned to user.
    second_email str
    Secondary email address of user typically used for account recovery.
    state str
    State or region component of user's address (region).
    status str
    Current status of user.
    street_address str
    Full street address component of user's address.
    timezone str
    User's time zone.
    title str
    User's title, such as "Vice President".
    user_type str
    Used to describe the organization to user relationship such as "Employee" or "Contractor".
    zip_code str
    Zipcode or postal code component of user's address (postalCode)
    compound_search_operator str
    delay_read_seconds str
    searches Sequence[GetUserSearch]
    skip_groups bool
    skip_roles bool
    user_id str
    adminRoles List<String>
    city String
    City or locality component of user's address.
    costCenter String
    Name of a cost center assigned to user.
    countryCode String
    Country name component of user's address.
    customProfileAttributes String
    Raw JSON containing all custom profile attributes.
    department String
    Name of user's department.
    displayName String
    Name of the user, suitable for display to end users.
    division String
    Name of user's division.
    email String
    Primary email address of user.
    employeeNumber String
    Organization or company assigned unique identifier for the user.
    firstName String
    Given name of the user.
    groupMemberships List<String>
    honorificPrefix String
    Honorific prefix(es) of the user, or title in most Western languages.
    honorificSuffix String
    Honorific suffix(es) of the user.
    id String
    The provider-assigned unique ID for this managed resource.
    lastName String
    Family name of the user.
    locale String
    User's default location for purposes of localizing items such as currency, date time format, numerical representations, etc.
    login String
    Unique identifier for the user.
    manager String
    Display name of the user's manager.
    managerId String
    id of a user's manager.
    middleName String
    Middle name(s) of the user.
    mobilePhone String
    Mobile phone number of user.
    nickName String
    Casual way to address the user in real life.
    organization String
    Name of user's organization.
    postalAddress String
    Mailing address component of user's address.
    preferredLanguage String
    User's preferred written or spoken languages.
    primaryPhone String
    Primary phone number of user such as home number.
    profileUrl String
    URL of user's online profile (e.g. a web page).
    roles List<String>
    All roles assigned to user.
    secondEmail String
    Secondary email address of user typically used for account recovery.
    state String
    State or region component of user's address (region).
    status String
    Current status of user.
    streetAddress String
    Full street address component of user's address.
    timezone String
    User's time zone.
    title String
    User's title, such as "Vice President".
    userType String
    Used to describe the organization to user relationship such as "Employee" or "Contractor".
    zipCode String
    Zipcode or postal code component of user's address (postalCode)
    compoundSearchOperator String
    delayReadSeconds String
    searches List<Property Map>
    skipGroups Boolean
    skipRoles Boolean
    userId String

    Supporting Types

    GetUserSearch

    Comparison string
    Comparison to use. Comparitors for strings: eq, ge, gt, le, lt, ne, pr, sw.
    Expression string
    A raw search expression string. If present it will override name/comparison/value.
    Name string
    Name of property to search against.
    Value string
    Value to compare with.
    Comparison string
    Comparison to use. Comparitors for strings: eq, ge, gt, le, lt, ne, pr, sw.
    Expression string
    A raw search expression string. If present it will override name/comparison/value.
    Name string
    Name of property to search against.
    Value string
    Value to compare with.
    comparison String
    Comparison to use. Comparitors for strings: eq, ge, gt, le, lt, ne, pr, sw.
    expression String
    A raw search expression string. If present it will override name/comparison/value.
    name String
    Name of property to search against.
    value String
    Value to compare with.
    comparison string
    Comparison to use. Comparitors for strings: eq, ge, gt, le, lt, ne, pr, sw.
    expression string
    A raw search expression string. If present it will override name/comparison/value.
    name string
    Name of property to search against.
    value string
    Value to compare with.
    comparison str
    Comparison to use. Comparitors for strings: eq, ge, gt, le, lt, ne, pr, sw.
    expression str
    A raw search expression string. If present it will override name/comparison/value.
    name str
    Name of property to search against.
    value str
    Value to compare with.
    comparison String
    Comparison to use. Comparitors for strings: eq, ge, gt, le, lt, ne, pr, sw.
    expression String
    A raw search expression string. If present it will override name/comparison/value.
    name String
    Name of property to search against.
    value String
    Value to compare with.

    Package Details

    Repository
    Okta pulumi/pulumi-okta
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the okta Terraform Provider.
    okta logo
    Okta v4.8.1 published on Thursday, Apr 18, 2024 by Pulumi