1. Packages
  2. Vultr
  3. API Docs
  4. getUser
Vultr v2.21.0 published on Wednesday, Jun 19, 2024 by dirien

vultr.getUser

Explore with Pulumi AI

vultr logo
Vultr v2.21.0 published on Wednesday, Jun 19, 2024 by dirien

    Get information about a Vultr user associated with your account. This data source provides the name, email, access control list, and API status for a Vultr user associated with your account.

    Example Usage

    Get the information for a user by email:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@pulumi/vultr";
    
    const myUser = vultr.getUser({
        filters: [{
            name: "email",
            values: ["jdoe@example.com"],
        }],
    });
    
    import pulumi
    import pulumi_vultr as vultr
    
    my_user = vultr.get_user(filters=[vultr.GetUserFilterArgs(
        name="email",
        values=["jdoe@example.com"],
    )])
    
    package main
    
    import (
    	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vultr.LookupUser(ctx, &vultr.LookupUserArgs{
    			Filters: []vultr.GetUserFilter{
    				{
    					Name: "email",
    					Values: []string{
    						"jdoe@example.com",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = Pulumi.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myUser = Vultr.GetUser.Invoke(new()
        {
            Filters = new[]
            {
                new Vultr.Inputs.GetUserFilterInputArgs
                {
                    Name = "email",
                    Values = new[]
                    {
                        "jdoe@example.com",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.VultrFunctions;
    import com.pulumi.vultr.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 myUser = VultrFunctions.getUser(GetUserArgs.builder()
                .filters(GetUserFilterArgs.builder()
                    .name("email")
                    .values("jdoe@example.com")
                    .build())
                .build());
    
        }
    }
    
    variables:
      myUser:
        fn::invoke:
          Function: vultr:getUser
          Arguments:
            filters:
              - name: email
                values:
                  - jdoe@example.com
    

    Get the information for a user by name:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@pulumi/vultr";
    
    const myUser = vultr.getUser({
        filters: [{
            name: "name",
            values: ["John Doe"],
        }],
    });
    
    import pulumi
    import pulumi_vultr as vultr
    
    my_user = vultr.get_user(filters=[vultr.GetUserFilterArgs(
        name="name",
        values=["John Doe"],
    )])
    
    package main
    
    import (
    	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vultr.LookupUser(ctx, &vultr.LookupUserArgs{
    			Filters: []vultr.GetUserFilter{
    				{
    					Name: "name",
    					Values: []string{
    						"John Doe",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = Pulumi.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myUser = Vultr.GetUser.Invoke(new()
        {
            Filters = new[]
            {
                new Vultr.Inputs.GetUserFilterInputArgs
                {
                    Name = "name",
                    Values = new[]
                    {
                        "John Doe",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.VultrFunctions;
    import com.pulumi.vultr.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 myUser = VultrFunctions.getUser(GetUserArgs.builder()
                .filters(GetUserFilterArgs.builder()
                    .name("name")
                    .values("John Doe")
                    .build())
                .build());
    
        }
    }
    
    variables:
      myUser:
        fn::invoke:
          Function: vultr:getUser
          Arguments:
            filters:
              - name: name
                values:
                  - John Doe
    

    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(filters: Optional[Sequence[GetUserFilter]] = None,
                 opts: Optional[InvokeOptions] = None) -> GetUserResult
    def get_user_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetUserFilterArgs]]]] = 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: vultr:index/getUser:getUser
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<ediri.Vultr.Inputs.GetUserFilter>
    Query parameters for finding users.
    Filters []GetUserFilter
    Query parameters for finding users.
    filters List<GetUserFilter>
    Query parameters for finding users.
    filters GetUserFilter[]
    Query parameters for finding users.
    filters Sequence[GetUserFilter]
    Query parameters for finding users.
    filters List<Property Map>
    Query parameters for finding users.

    getUser Result

    The following output properties are available:

    Acls List<string>
    The access control list for the user.
    ApiEnabled bool
    Whether API is enabled for the user.
    Email string
    The email of the user.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the user.
    Filters List<ediri.Vultr.Outputs.GetUserFilter>
    Acls []string
    The access control list for the user.
    ApiEnabled bool
    Whether API is enabled for the user.
    Email string
    The email of the user.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the user.
    Filters []GetUserFilter
    acls List<String>
    The access control list for the user.
    apiEnabled Boolean
    Whether API is enabled for the user.
    email String
    The email of the user.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the user.
    filters List<GetUserFilter>
    acls string[]
    The access control list for the user.
    apiEnabled boolean
    Whether API is enabled for the user.
    email string
    The email of the user.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the user.
    filters GetUserFilter[]
    acls Sequence[str]
    The access control list for the user.
    api_enabled bool
    Whether API is enabled for the user.
    email str
    The email of the user.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the user.
    filters Sequence[GetUserFilter]
    acls List<String>
    The access control list for the user.
    apiEnabled Boolean
    Whether API is enabled for the user.
    email String
    The email of the user.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the user.
    filters List<Property Map>

    Supporting Types

    GetUserFilter

    Name string
    Attribute name to filter with.
    Values List<string>
    One or more values filter with.
    Name string
    Attribute name to filter with.
    Values []string
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.
    name string
    Attribute name to filter with.
    values string[]
    One or more values filter with.
    name str
    Attribute name to filter with.
    values Sequence[str]
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.

    Package Details

    Repository
    vultr dirien/pulumi-vultr
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vultr Terraform Provider.
    vultr logo
    Vultr v2.21.0 published on Wednesday, Jun 19, 2024 by dirien