github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/memorydb/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 memorydb
     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 information about a MemoryDB 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/memorydb"
    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 := memorydb.LookupUser(ctx, &memorydb.LookupUserArgs{
    32  //				UserName: "my-user",
    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:memorydb/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  	// Map of tags assigned to the subnet group.
    56  	Tags map[string]string `pulumi:"tags"`
    57  	// Name of the user.
    58  	UserName string `pulumi:"userName"`
    59  }
    60  
    61  // A collection of values returned by getUser.
    62  type LookupUserResult struct {
    63  	// Access permissions string used for this user.
    64  	AccessString string `pulumi:"accessString"`
    65  	// ARN of the user.
    66  	Arn string `pulumi:"arn"`
    67  	// Denotes the user's authentication properties.
    68  	AuthenticationModes []GetUserAuthenticationMode `pulumi:"authenticationModes"`
    69  	// The provider-assigned unique ID for this managed resource.
    70  	Id string `pulumi:"id"`
    71  	// The minimum engine version supported for the user.
    72  	MinimumEngineVersion string `pulumi:"minimumEngineVersion"`
    73  	// Map of tags assigned to the subnet group.
    74  	Tags     map[string]string `pulumi:"tags"`
    75  	UserName string            `pulumi:"userName"`
    76  }
    77  
    78  func LookupUserOutput(ctx *pulumi.Context, args LookupUserOutputArgs, opts ...pulumi.InvokeOption) LookupUserResultOutput {
    79  	return pulumi.ToOutputWithContext(context.Background(), args).
    80  		ApplyT(func(v interface{}) (LookupUserResult, error) {
    81  			args := v.(LookupUserArgs)
    82  			r, err := LookupUser(ctx, &args, opts...)
    83  			var s LookupUserResult
    84  			if r != nil {
    85  				s = *r
    86  			}
    87  			return s, err
    88  		}).(LookupUserResultOutput)
    89  }
    90  
    91  // A collection of arguments for invoking getUser.
    92  type LookupUserOutputArgs struct {
    93  	// Map of tags assigned to the subnet group.
    94  	Tags pulumi.StringMapInput `pulumi:"tags"`
    95  	// Name of the user.
    96  	UserName pulumi.StringInput `pulumi:"userName"`
    97  }
    98  
    99  func (LookupUserOutputArgs) ElementType() reflect.Type {
   100  	return reflect.TypeOf((*LookupUserArgs)(nil)).Elem()
   101  }
   102  
   103  // A collection of values returned by getUser.
   104  type LookupUserResultOutput struct{ *pulumi.OutputState }
   105  
   106  func (LookupUserResultOutput) ElementType() reflect.Type {
   107  	return reflect.TypeOf((*LookupUserResult)(nil)).Elem()
   108  }
   109  
   110  func (o LookupUserResultOutput) ToLookupUserResultOutput() LookupUserResultOutput {
   111  	return o
   112  }
   113  
   114  func (o LookupUserResultOutput) ToLookupUserResultOutputWithContext(ctx context.Context) LookupUserResultOutput {
   115  	return o
   116  }
   117  
   118  // Access permissions string used for this user.
   119  func (o LookupUserResultOutput) AccessString() pulumi.StringOutput {
   120  	return o.ApplyT(func(v LookupUserResult) string { return v.AccessString }).(pulumi.StringOutput)
   121  }
   122  
   123  // ARN of the user.
   124  func (o LookupUserResultOutput) Arn() pulumi.StringOutput {
   125  	return o.ApplyT(func(v LookupUserResult) string { return v.Arn }).(pulumi.StringOutput)
   126  }
   127  
   128  // Denotes the user's authentication properties.
   129  func (o LookupUserResultOutput) AuthenticationModes() GetUserAuthenticationModeArrayOutput {
   130  	return o.ApplyT(func(v LookupUserResult) []GetUserAuthenticationMode { return v.AuthenticationModes }).(GetUserAuthenticationModeArrayOutput)
   131  }
   132  
   133  // The provider-assigned unique ID for this managed resource.
   134  func (o LookupUserResultOutput) Id() pulumi.StringOutput {
   135  	return o.ApplyT(func(v LookupUserResult) string { return v.Id }).(pulumi.StringOutput)
   136  }
   137  
   138  // The minimum engine version supported for the user.
   139  func (o LookupUserResultOutput) MinimumEngineVersion() pulumi.StringOutput {
   140  	return o.ApplyT(func(v LookupUserResult) string { return v.MinimumEngineVersion }).(pulumi.StringOutput)
   141  }
   142  
   143  // Map of tags assigned to the subnet group.
   144  func (o LookupUserResultOutput) Tags() pulumi.StringMapOutput {
   145  	return o.ApplyT(func(v LookupUserResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   146  }
   147  
   148  func (o LookupUserResultOutput) UserName() pulumi.StringOutput {
   149  	return o.ApplyT(func(v LookupUserResult) string { return v.UserName }).(pulumi.StringOutput)
   150  }
   151  
   152  func init() {
   153  	pulumi.RegisterOutputType(LookupUserResultOutput{})
   154  }