github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/elasticache/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 elasticache
     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  // Use this data source to get information about an ElastiCache User.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticache"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := elasticache.LookupUser(ctx, &elasticache.LookupUserArgs{
    32  //				UserId: "example",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupUser(ctx *pulumi.Context, args *LookupUserArgs, opts ...pulumi.InvokeOption) (*LookupUserResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupUserResult
    46  	err := ctx.Invoke("aws:elasticache/getUser:getUser", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getUser.
    54  type LookupUserArgs struct {
    55  	// String for what access a user possesses within the associated ElastiCache replication groups or clusters.
    56  	AccessString        *string                     `pulumi:"accessString"`
    57  	AuthenticationModes []GetUserAuthenticationMode `pulumi:"authenticationModes"`
    58  	Engine              *string                     `pulumi:"engine"`
    59  	NoPasswordRequired  *bool                       `pulumi:"noPasswordRequired"`
    60  	Passwords           []string                    `pulumi:"passwords"`
    61  	// Identifier for the user.
    62  	UserId string `pulumi:"userId"`
    63  	// User name of the user.
    64  	UserName *string `pulumi:"userName"`
    65  }
    66  
    67  // A collection of values returned by getUser.
    68  type LookupUserResult struct {
    69  	// String for what access a user possesses within the associated ElastiCache replication groups or clusters.
    70  	AccessString        *string                     `pulumi:"accessString"`
    71  	AuthenticationModes []GetUserAuthenticationMode `pulumi:"authenticationModes"`
    72  	Engine              *string                     `pulumi:"engine"`
    73  	// The provider-assigned unique ID for this managed resource.
    74  	Id                 string   `pulumi:"id"`
    75  	NoPasswordRequired *bool    `pulumi:"noPasswordRequired"`
    76  	Passwords          []string `pulumi:"passwords"`
    77  	// Identifier for the user.
    78  	UserId string `pulumi:"userId"`
    79  	// User name of the user.
    80  	UserName *string `pulumi:"userName"`
    81  }
    82  
    83  func LookupUserOutput(ctx *pulumi.Context, args LookupUserOutputArgs, opts ...pulumi.InvokeOption) LookupUserResultOutput {
    84  	return pulumi.ToOutputWithContext(context.Background(), args).
    85  		ApplyT(func(v interface{}) (LookupUserResult, error) {
    86  			args := v.(LookupUserArgs)
    87  			r, err := LookupUser(ctx, &args, opts...)
    88  			var s LookupUserResult
    89  			if r != nil {
    90  				s = *r
    91  			}
    92  			return s, err
    93  		}).(LookupUserResultOutput)
    94  }
    95  
    96  // A collection of arguments for invoking getUser.
    97  type LookupUserOutputArgs struct {
    98  	// String for what access a user possesses within the associated ElastiCache replication groups or clusters.
    99  	AccessString        pulumi.StringPtrInput               `pulumi:"accessString"`
   100  	AuthenticationModes GetUserAuthenticationModeArrayInput `pulumi:"authenticationModes"`
   101  	Engine              pulumi.StringPtrInput               `pulumi:"engine"`
   102  	NoPasswordRequired  pulumi.BoolPtrInput                 `pulumi:"noPasswordRequired"`
   103  	Passwords           pulumi.StringArrayInput             `pulumi:"passwords"`
   104  	// Identifier for the user.
   105  	UserId pulumi.StringInput `pulumi:"userId"`
   106  	// User name of the user.
   107  	UserName pulumi.StringPtrInput `pulumi:"userName"`
   108  }
   109  
   110  func (LookupUserOutputArgs) ElementType() reflect.Type {
   111  	return reflect.TypeOf((*LookupUserArgs)(nil)).Elem()
   112  }
   113  
   114  // A collection of values returned by getUser.
   115  type LookupUserResultOutput struct{ *pulumi.OutputState }
   116  
   117  func (LookupUserResultOutput) ElementType() reflect.Type {
   118  	return reflect.TypeOf((*LookupUserResult)(nil)).Elem()
   119  }
   120  
   121  func (o LookupUserResultOutput) ToLookupUserResultOutput() LookupUserResultOutput {
   122  	return o
   123  }
   124  
   125  func (o LookupUserResultOutput) ToLookupUserResultOutputWithContext(ctx context.Context) LookupUserResultOutput {
   126  	return o
   127  }
   128  
   129  // String for what access a user possesses within the associated ElastiCache replication groups or clusters.
   130  func (o LookupUserResultOutput) AccessString() pulumi.StringPtrOutput {
   131  	return o.ApplyT(func(v LookupUserResult) *string { return v.AccessString }).(pulumi.StringPtrOutput)
   132  }
   133  
   134  func (o LookupUserResultOutput) AuthenticationModes() GetUserAuthenticationModeArrayOutput {
   135  	return o.ApplyT(func(v LookupUserResult) []GetUserAuthenticationMode { return v.AuthenticationModes }).(GetUserAuthenticationModeArrayOutput)
   136  }
   137  
   138  func (o LookupUserResultOutput) Engine() pulumi.StringPtrOutput {
   139  	return o.ApplyT(func(v LookupUserResult) *string { return v.Engine }).(pulumi.StringPtrOutput)
   140  }
   141  
   142  // The provider-assigned unique ID for this managed resource.
   143  func (o LookupUserResultOutput) Id() pulumi.StringOutput {
   144  	return o.ApplyT(func(v LookupUserResult) string { return v.Id }).(pulumi.StringOutput)
   145  }
   146  
   147  func (o LookupUserResultOutput) NoPasswordRequired() pulumi.BoolPtrOutput {
   148  	return o.ApplyT(func(v LookupUserResult) *bool { return v.NoPasswordRequired }).(pulumi.BoolPtrOutput)
   149  }
   150  
   151  func (o LookupUserResultOutput) Passwords() pulumi.StringArrayOutput {
   152  	return o.ApplyT(func(v LookupUserResult) []string { return v.Passwords }).(pulumi.StringArrayOutput)
   153  }
   154  
   155  // Identifier for the user.
   156  func (o LookupUserResultOutput) UserId() pulumi.StringOutput {
   157  	return o.ApplyT(func(v LookupUserResult) string { return v.UserId }).(pulumi.StringOutput)
   158  }
   159  
   160  // User name of the user.
   161  func (o LookupUserResultOutput) UserName() pulumi.StringPtrOutput {
   162  	return o.ApplyT(func(v LookupUserResult) *string { return v.UserName }).(pulumi.StringPtrOutput)
   163  }
   164  
   165  func init() {
   166  	pulumi.RegisterOutputType(LookupUserResultOutput{})
   167  }