github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ecr/getCredentials.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 ecr
     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  func GetCredentials(ctx *pulumi.Context, args *GetCredentialsArgs, opts ...pulumi.InvokeOption) (*GetCredentialsResult, error) {
    15  	opts = internal.PkgInvokeDefaultOpts(opts)
    16  	var rv GetCredentialsResult
    17  	err := ctx.Invoke("aws:ecr/getCredentials:getCredentials", args, &rv, opts...)
    18  	if err != nil {
    19  		return nil, err
    20  	}
    21  	return &rv, nil
    22  }
    23  
    24  // A collection of arguments for invoking getCredentials.
    25  type GetCredentialsArgs struct {
    26  	RegistryId string `pulumi:"registryId"`
    27  }
    28  
    29  // A collection of values returned by getCredentials.
    30  type GetCredentialsResult struct {
    31  	AuthorizationToken string `pulumi:"authorizationToken"`
    32  	ExpiresAt          string `pulumi:"expiresAt"`
    33  	// The provider-assigned unique ID for this managed resource.
    34  	Id            string `pulumi:"id"`
    35  	ProxyEndpoint string `pulumi:"proxyEndpoint"`
    36  	RegistryId    string `pulumi:"registryId"`
    37  }
    38  
    39  func GetCredentialsOutput(ctx *pulumi.Context, args GetCredentialsOutputArgs, opts ...pulumi.InvokeOption) GetCredentialsResultOutput {
    40  	return pulumi.ToOutputWithContext(context.Background(), args).
    41  		ApplyT(func(v interface{}) (GetCredentialsResult, error) {
    42  			args := v.(GetCredentialsArgs)
    43  			r, err := GetCredentials(ctx, &args, opts...)
    44  			var s GetCredentialsResult
    45  			if r != nil {
    46  				s = *r
    47  			}
    48  			return s, err
    49  		}).(GetCredentialsResultOutput)
    50  }
    51  
    52  // A collection of arguments for invoking getCredentials.
    53  type GetCredentialsOutputArgs struct {
    54  	RegistryId pulumi.StringInput `pulumi:"registryId"`
    55  }
    56  
    57  func (GetCredentialsOutputArgs) ElementType() reflect.Type {
    58  	return reflect.TypeOf((*GetCredentialsArgs)(nil)).Elem()
    59  }
    60  
    61  // A collection of values returned by getCredentials.
    62  type GetCredentialsResultOutput struct{ *pulumi.OutputState }
    63  
    64  func (GetCredentialsResultOutput) ElementType() reflect.Type {
    65  	return reflect.TypeOf((*GetCredentialsResult)(nil)).Elem()
    66  }
    67  
    68  func (o GetCredentialsResultOutput) ToGetCredentialsResultOutput() GetCredentialsResultOutput {
    69  	return o
    70  }
    71  
    72  func (o GetCredentialsResultOutput) ToGetCredentialsResultOutputWithContext(ctx context.Context) GetCredentialsResultOutput {
    73  	return o
    74  }
    75  
    76  func (o GetCredentialsResultOutput) AuthorizationToken() pulumi.StringOutput {
    77  	return o.ApplyT(func(v GetCredentialsResult) string { return v.AuthorizationToken }).(pulumi.StringOutput)
    78  }
    79  
    80  func (o GetCredentialsResultOutput) ExpiresAt() pulumi.StringOutput {
    81  	return o.ApplyT(func(v GetCredentialsResult) string { return v.ExpiresAt }).(pulumi.StringOutput)
    82  }
    83  
    84  // The provider-assigned unique ID for this managed resource.
    85  func (o GetCredentialsResultOutput) Id() pulumi.StringOutput {
    86  	return o.ApplyT(func(v GetCredentialsResult) string { return v.Id }).(pulumi.StringOutput)
    87  }
    88  
    89  func (o GetCredentialsResultOutput) ProxyEndpoint() pulumi.StringOutput {
    90  	return o.ApplyT(func(v GetCredentialsResult) string { return v.ProxyEndpoint }).(pulumi.StringOutput)
    91  }
    92  
    93  func (o GetCredentialsResultOutput) RegistryId() pulumi.StringOutput {
    94  	return o.ApplyT(func(v GetCredentialsResult) string { return v.RegistryId }).(pulumi.StringOutput)
    95  }
    96  
    97  func init() {
    98  	pulumi.RegisterOutputType(GetCredentialsResultOutput{})
    99  }