1. Packages
  2. Packages
  3. Formal Provider
  4. API Docs
  5. getUser
Viewing docs for Formal v1.2.2
published on Wednesday, Jul 15, 2026 by Formal
formal logo
Viewing docs for Formal v1.2.2
published on Wednesday, Jul 15, 2026 by Formal

    Data source for looking up a User by ID or by identity. Use either id or dbUsername, but not both. A human user’s identity is idp:formal:human:<email>, so this can resolve an email to a user ID, for example to add a user to a Group with formalGroupLinkUser.

    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(db_username: Optional[str] = None,
                 id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetUserResult
    def get_user_output(db_username: pulumi.Input[Optional[str]] = None,
                 id: pulumi.Input[Optional[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)
    public static Output<GetUserResult> getUser(GetUserArgs args, InvokeOptions options)
    
    fn::invoke:
      function: formal:index/getUser:getUser
      arguments:
        # arguments dictionary
    data "formal_get_user" "name" {
        # arguments
    }

    The following arguments are supported:

    DbUsername string
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    Id string
    The ID of the User to look up.
    DbUsername string
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    Id string
    The ID of the User to look up.
    db_username string
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id string
    The ID of the User to look up.
    dbUsername String
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id String
    The ID of the User to look up.
    dbUsername string
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id string
    The ID of the User to look up.
    db_username str
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id str
    The ID of the User to look up.
    dbUsername String
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id String
    The ID of the User to look up.

    getUser Result

    The following output properties are available:

    Email string
    The email of this User. Only set for human users.
    FirstName string
    The first name of this User. Only set for human users.
    FullName string
    The full name of this User.
    GroupIds List<string>
    The IDs of the Groups this User belongs to.
    LastName string
    The last name of this User. Only set for human users.
    TerminationProtection bool
    If set to true, this User cannot be deleted.
    Type string
    The type of this User, either human or machine.
    DbUsername string
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    Id string
    The ID of the User to look up.
    Email string
    The email of this User. Only set for human users.
    FirstName string
    The first name of this User. Only set for human users.
    FullName string
    The full name of this User.
    GroupIds []string
    The IDs of the Groups this User belongs to.
    LastName string
    The last name of this User. Only set for human users.
    TerminationProtection bool
    If set to true, this User cannot be deleted.
    Type string
    The type of this User, either human or machine.
    DbUsername string
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    Id string
    The ID of the User to look up.
    email string
    The email of this User. Only set for human users.
    first_name string
    The first name of this User. Only set for human users.
    full_name string
    The full name of this User.
    group_ids list(string)
    The IDs of the Groups this User belongs to.
    last_name string
    The last name of this User. Only set for human users.
    termination_protection bool
    If set to true, this User cannot be deleted.
    type string
    The type of this User, either human or machine.
    db_username string
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id string
    The ID of the User to look up.
    email String
    The email of this User. Only set for human users.
    firstName String
    The first name of this User. Only set for human users.
    fullName String
    The full name of this User.
    groupIds List<String>
    The IDs of the Groups this User belongs to.
    lastName String
    The last name of this User. Only set for human users.
    terminationProtection Boolean
    If set to true, this User cannot be deleted.
    type String
    The type of this User, either human or machine.
    dbUsername String
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id String
    The ID of the User to look up.
    email string
    The email of this User. Only set for human users.
    firstName string
    The first name of this User. Only set for human users.
    fullName string
    The full name of this User.
    groupIds string[]
    The IDs of the Groups this User belongs to.
    lastName string
    The last name of this User. Only set for human users.
    terminationProtection boolean
    If set to true, this User cannot be deleted.
    type string
    The type of this User, either human or machine.
    dbUsername string
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id string
    The ID of the User to look up.
    email str
    The email of this User. Only set for human users.
    first_name str
    The first name of this User. Only set for human users.
    full_name str
    The full name of this User.
    group_ids Sequence[str]
    The IDs of the Groups this User belongs to.
    last_name str
    The last name of this User. Only set for human users.
    termination_protection bool
    If set to true, this User cannot be deleted.
    type str
    The type of this User, either human or machine.
    db_username str
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id str
    The ID of the User to look up.
    email String
    The email of this User. Only set for human users.
    firstName String
    The first name of this User. Only set for human users.
    fullName String
    The full name of this User.
    groupIds List<String>
    The IDs of the Groups this User belongs to.
    lastName String
    The last name of this User. Only set for human users.
    terminationProtection Boolean
    If set to true, this User cannot be deleted.
    type String
    The type of this User, either human or machine.
    dbUsername String
    The identity of the User to look up, for example idp:formal:human:jane@example.com.
    id String
    The ID of the User to look up.

    Package Details

    Repository
    formal formalco/pulumi-formal
    License
    MPL-2.0
    Notes
    This Pulumi package is based on the formal Terraform Provider.
    formal logo
    Viewing docs for Formal v1.2.2
    published on Wednesday, Jul 15, 2026 by Formal

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial