1. Packages
  2. Scaleway
  3. API Docs
  4. getIamUser
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

scaleway.getIamUser

Explore with Pulumi AI

scaleway logo
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

    Use this data source to get information on an existing IAM user based on its ID or email address. For more information, see the documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumi/scaleway";
    
    const findById = scaleway.getIamUser({
        userId: "11111111-1111-1111-1111-111111111111",
    });
    const findByEmail = scaleway.getIamUser({
        email: "foo@bar.com",
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    find_by_id = scaleway.get_iam_user(user_id="11111111-1111-1111-1111-111111111111")
    find_by_email = scaleway.get_iam_user(email="foo@bar.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := scaleway.LookupIamUser(ctx, &scaleway.LookupIamUserArgs{
    			UserId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.LookupIamUser(ctx, &scaleway.LookupIamUserArgs{
    			Email: pulumi.StringRef("foo@bar.com"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var findById = Scaleway.GetIamUser.Invoke(new()
        {
            UserId = "11111111-1111-1111-1111-111111111111",
        });
    
        var findByEmail = Scaleway.GetIamUser.Invoke(new()
        {
            Email = "foo@bar.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.ScalewayFunctions;
    import com.pulumi.scaleway.inputs.GetIamUserArgs;
    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 findById = ScalewayFunctions.getIamUser(GetIamUserArgs.builder()
                .userId("11111111-1111-1111-1111-111111111111")
                .build());
    
            final var findByEmail = ScalewayFunctions.getIamUser(GetIamUserArgs.builder()
                .email("foo@bar.com")
                .build());
    
        }
    }
    
    variables:
      findById:
        fn::invoke:
          Function: scaleway:getIamUser
          Arguments:
            userId: 11111111-1111-1111-1111-111111111111
      findByEmail:
        fn::invoke:
          Function: scaleway:getIamUser
          Arguments:
            email: foo@bar.com
    

    Using getIamUser

    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 getIamUser(args: GetIamUserArgs, opts?: InvokeOptions): Promise<GetIamUserResult>
    function getIamUserOutput(args: GetIamUserOutputArgs, opts?: InvokeOptions): Output<GetIamUserResult>
    def get_iam_user(email: Optional[str] = None,
                     organization_id: Optional[str] = None,
                     user_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetIamUserResult
    def get_iam_user_output(email: Optional[pulumi.Input[str]] = None,
                     organization_id: Optional[pulumi.Input[str]] = None,
                     user_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetIamUserResult]
    func LookupIamUser(ctx *Context, args *LookupIamUserArgs, opts ...InvokeOption) (*LookupIamUserResult, error)
    func LookupIamUserOutput(ctx *Context, args *LookupIamUserOutputArgs, opts ...InvokeOption) LookupIamUserResultOutput

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

    public static class GetIamUser 
    {
        public static Task<GetIamUserResult> InvokeAsync(GetIamUserArgs args, InvokeOptions? opts = null)
        public static Output<GetIamUserResult> Invoke(GetIamUserInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIamUserResult> getIamUser(GetIamUserArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: scaleway:index/getIamUser:getIamUser
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Email string
    The email address of the IAM user. Only one of the email and user_id should be specified.
    OrganizationId string
    organization_id) The ID of the organization the user is associated with.
    UserId string
    The ID of the IAM user. Only one of the email and user_id should be specified.
    Email string
    The email address of the IAM user. Only one of the email and user_id should be specified.
    OrganizationId string
    organization_id) The ID of the organization the user is associated with.
    UserId string
    The ID of the IAM user. Only one of the email and user_id should be specified.
    email String
    The email address of the IAM user. Only one of the email and user_id should be specified.
    organizationId String
    organization_id) The ID of the organization the user is associated with.
    userId String
    The ID of the IAM user. Only one of the email and user_id should be specified.
    email string
    The email address of the IAM user. Only one of the email and user_id should be specified.
    organizationId string
    organization_id) The ID of the organization the user is associated with.
    userId string
    The ID of the IAM user. Only one of the email and user_id should be specified.
    email str
    The email address of the IAM user. Only one of the email and user_id should be specified.
    organization_id str
    organization_id) The ID of the organization the user is associated with.
    user_id str
    The ID of the IAM user. Only one of the email and user_id should be specified.
    email String
    The email address of the IAM user. Only one of the email and user_id should be specified.
    organizationId String
    organization_id) The ID of the organization the user is associated with.
    userId String
    The ID of the IAM user. Only one of the email and user_id should be specified.

    getIamUser Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Email string
    OrganizationId string
    UserId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Email string
    OrganizationId string
    UserId string
    id String
    The provider-assigned unique ID for this managed resource.
    email String
    organizationId String
    userId String
    id string
    The provider-assigned unique ID for this managed resource.
    email string
    organizationId string
    userId string
    id str
    The provider-assigned unique ID for this managed resource.
    email str
    organization_id str
    user_id str
    id String
    The provider-assigned unique ID for this managed resource.
    email String
    organizationId String
    userId String

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse