github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/connect/getUser.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package connect
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides details about a specific Amazon Connect User.
    15  //
    16  // ## Example Usage
    17  //
    18  // By `name`
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/connect"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := connect.LookupUser(ctx, &connect.LookupUserArgs{
    34  //				InstanceId: "aaaaaaaa-bbbb-cccc-dddd-111111111111",
    35  //				Name:       pulumi.StringRef("Example"),
    36  //			}, nil)
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  //
    47  // By `userId`
    48  //
    49  // <!--Start PulumiCodeChooser -->
    50  // ```go
    51  // package main
    52  //
    53  // import (
    54  //
    55  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/connect"
    56  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    57  //
    58  // )
    59  //
    60  //	func main() {
    61  //		pulumi.Run(func(ctx *pulumi.Context) error {
    62  //			_, err := connect.LookupUser(ctx, &connect.LookupUserArgs{
    63  //				InstanceId: "aaaaaaaa-bbbb-cccc-dddd-111111111111",
    64  //				UserId:     pulumi.StringRef("cccccccc-bbbb-cccc-dddd-111111111111"),
    65  //			}, nil)
    66  //			if err != nil {
    67  //				return err
    68  //			}
    69  //			return nil
    70  //		})
    71  //	}
    72  //
    73  // ```
    74  // <!--End PulumiCodeChooser -->
    75  func LookupUser(ctx *pulumi.Context, args *LookupUserArgs, opts ...pulumi.InvokeOption) (*LookupUserResult, error) {
    76  	opts = internal.PkgInvokeDefaultOpts(opts)
    77  	var rv LookupUserResult
    78  	err := ctx.Invoke("aws:connect/getUser:getUser", args, &rv, opts...)
    79  	if err != nil {
    80  		return nil, err
    81  	}
    82  	return &rv, nil
    83  }
    84  
    85  // A collection of arguments for invoking getUser.
    86  type LookupUserArgs struct {
    87  	// Reference to the hosting Amazon Connect Instance
    88  	InstanceId string `pulumi:"instanceId"`
    89  	// Returns information on a specific User by name
    90  	Name *string `pulumi:"name"`
    91  	// A map of tags to assign to the User.
    92  	Tags map[string]string `pulumi:"tags"`
    93  	// Returns information on a specific User by User id
    94  	UserId *string `pulumi:"userId"`
    95  }
    96  
    97  // A collection of values returned by getUser.
    98  type LookupUserResult struct {
    99  	// The Amazon Resource Name (ARN) of the User.
   100  	Arn string `pulumi:"arn"`
   101  	// The identifier of the user account in the directory used for identity management.
   102  	DirectoryUserId string `pulumi:"directoryUserId"`
   103  	// The identifier of the hierarchy group for the user.
   104  	HierarchyGroupId string `pulumi:"hierarchyGroupId"`
   105  	// The provider-assigned unique ID for this managed resource.
   106  	Id string `pulumi:"id"`
   107  	// A block that contains information about the identity of the user. Documented below.
   108  	IdentityInfos []GetUserIdentityInfo `pulumi:"identityInfos"`
   109  	// Specifies the identifier of the hosting Amazon Connect Instance.
   110  	InstanceId string `pulumi:"instanceId"`
   111  	Name       string `pulumi:"name"`
   112  	// A block that contains information about the phone settings for the user. Documented below.
   113  	PhoneConfigs []GetUserPhoneConfig `pulumi:"phoneConfigs"`
   114  	// The identifier of the routing profile for the user.
   115  	RoutingProfileId string `pulumi:"routingProfileId"`
   116  	// A list of identifiers for the security profiles for the user.
   117  	SecurityProfileIds []string `pulumi:"securityProfileIds"`
   118  	// A map of tags to assign to the User.
   119  	Tags   map[string]string `pulumi:"tags"`
   120  	UserId string            `pulumi:"userId"`
   121  }
   122  
   123  func LookupUserOutput(ctx *pulumi.Context, args LookupUserOutputArgs, opts ...pulumi.InvokeOption) LookupUserResultOutput {
   124  	return pulumi.ToOutputWithContext(context.Background(), args).
   125  		ApplyT(func(v interface{}) (LookupUserResult, error) {
   126  			args := v.(LookupUserArgs)
   127  			r, err := LookupUser(ctx, &args, opts...)
   128  			var s LookupUserResult
   129  			if r != nil {
   130  				s = *r
   131  			}
   132  			return s, err
   133  		}).(LookupUserResultOutput)
   134  }
   135  
   136  // A collection of arguments for invoking getUser.
   137  type LookupUserOutputArgs struct {
   138  	// Reference to the hosting Amazon Connect Instance
   139  	InstanceId pulumi.StringInput `pulumi:"instanceId"`
   140  	// Returns information on a specific User by name
   141  	Name pulumi.StringPtrInput `pulumi:"name"`
   142  	// A map of tags to assign to the User.
   143  	Tags pulumi.StringMapInput `pulumi:"tags"`
   144  	// Returns information on a specific User by User id
   145  	UserId pulumi.StringPtrInput `pulumi:"userId"`
   146  }
   147  
   148  func (LookupUserOutputArgs) ElementType() reflect.Type {
   149  	return reflect.TypeOf((*LookupUserArgs)(nil)).Elem()
   150  }
   151  
   152  // A collection of values returned by getUser.
   153  type LookupUserResultOutput struct{ *pulumi.OutputState }
   154  
   155  func (LookupUserResultOutput) ElementType() reflect.Type {
   156  	return reflect.TypeOf((*LookupUserResult)(nil)).Elem()
   157  }
   158  
   159  func (o LookupUserResultOutput) ToLookupUserResultOutput() LookupUserResultOutput {
   160  	return o
   161  }
   162  
   163  func (o LookupUserResultOutput) ToLookupUserResultOutputWithContext(ctx context.Context) LookupUserResultOutput {
   164  	return o
   165  }
   166  
   167  // The Amazon Resource Name (ARN) of the User.
   168  func (o LookupUserResultOutput) Arn() pulumi.StringOutput {
   169  	return o.ApplyT(func(v LookupUserResult) string { return v.Arn }).(pulumi.StringOutput)
   170  }
   171  
   172  // The identifier of the user account in the directory used for identity management.
   173  func (o LookupUserResultOutput) DirectoryUserId() pulumi.StringOutput {
   174  	return o.ApplyT(func(v LookupUserResult) string { return v.DirectoryUserId }).(pulumi.StringOutput)
   175  }
   176  
   177  // The identifier of the hierarchy group for the user.
   178  func (o LookupUserResultOutput) HierarchyGroupId() pulumi.StringOutput {
   179  	return o.ApplyT(func(v LookupUserResult) string { return v.HierarchyGroupId }).(pulumi.StringOutput)
   180  }
   181  
   182  // The provider-assigned unique ID for this managed resource.
   183  func (o LookupUserResultOutput) Id() pulumi.StringOutput {
   184  	return o.ApplyT(func(v LookupUserResult) string { return v.Id }).(pulumi.StringOutput)
   185  }
   186  
   187  // A block that contains information about the identity of the user. Documented below.
   188  func (o LookupUserResultOutput) IdentityInfos() GetUserIdentityInfoArrayOutput {
   189  	return o.ApplyT(func(v LookupUserResult) []GetUserIdentityInfo { return v.IdentityInfos }).(GetUserIdentityInfoArrayOutput)
   190  }
   191  
   192  // Specifies the identifier of the hosting Amazon Connect Instance.
   193  func (o LookupUserResultOutput) InstanceId() pulumi.StringOutput {
   194  	return o.ApplyT(func(v LookupUserResult) string { return v.InstanceId }).(pulumi.StringOutput)
   195  }
   196  
   197  func (o LookupUserResultOutput) Name() pulumi.StringOutput {
   198  	return o.ApplyT(func(v LookupUserResult) string { return v.Name }).(pulumi.StringOutput)
   199  }
   200  
   201  // A block that contains information about the phone settings for the user. Documented below.
   202  func (o LookupUserResultOutput) PhoneConfigs() GetUserPhoneConfigArrayOutput {
   203  	return o.ApplyT(func(v LookupUserResult) []GetUserPhoneConfig { return v.PhoneConfigs }).(GetUserPhoneConfigArrayOutput)
   204  }
   205  
   206  // The identifier of the routing profile for the user.
   207  func (o LookupUserResultOutput) RoutingProfileId() pulumi.StringOutput {
   208  	return o.ApplyT(func(v LookupUserResult) string { return v.RoutingProfileId }).(pulumi.StringOutput)
   209  }
   210  
   211  // A list of identifiers for the security profiles for the user.
   212  func (o LookupUserResultOutput) SecurityProfileIds() pulumi.StringArrayOutput {
   213  	return o.ApplyT(func(v LookupUserResult) []string { return v.SecurityProfileIds }).(pulumi.StringArrayOutput)
   214  }
   215  
   216  // A map of tags to assign to the User.
   217  func (o LookupUserResultOutput) Tags() pulumi.StringMapOutput {
   218  	return o.ApplyT(func(v LookupUserResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   219  }
   220  
   221  func (o LookupUserResultOutput) UserId() pulumi.StringOutput {
   222  	return o.ApplyT(func(v LookupUserResult) string { return v.UserId }).(pulumi.StringOutput)
   223  }
   224  
   225  func init() {
   226  	pulumi.RegisterOutputType(LookupUserResultOutput{})
   227  }