github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/kms/getSecret.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 kms
     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 GetSecret(ctx *pulumi.Context, args *GetSecretArgs, opts ...pulumi.InvokeOption) (*GetSecretResult, error) {
    15  	opts = internal.PkgInvokeDefaultOpts(opts)
    16  	var rv GetSecretResult
    17  	err := ctx.Invoke("aws:kms/getSecret:getSecret", 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 getSecret.
    25  type GetSecretArgs struct {
    26  	Secrets []GetSecretSecret `pulumi:"secrets"`
    27  }
    28  
    29  // A collection of values returned by getSecret.
    30  type GetSecretResult struct {
    31  	// The provider-assigned unique ID for this managed resource.
    32  	Id      string            `pulumi:"id"`
    33  	Secrets []GetSecretSecret `pulumi:"secrets"`
    34  }
    35  
    36  func GetSecretOutput(ctx *pulumi.Context, args GetSecretOutputArgs, opts ...pulumi.InvokeOption) GetSecretResultOutput {
    37  	return pulumi.ToOutputWithContext(context.Background(), args).
    38  		ApplyT(func(v interface{}) (GetSecretResult, error) {
    39  			args := v.(GetSecretArgs)
    40  			r, err := GetSecret(ctx, &args, opts...)
    41  			var s GetSecretResult
    42  			if r != nil {
    43  				s = *r
    44  			}
    45  			return s, err
    46  		}).(GetSecretResultOutput)
    47  }
    48  
    49  // A collection of arguments for invoking getSecret.
    50  type GetSecretOutputArgs struct {
    51  	Secrets GetSecretSecretArrayInput `pulumi:"secrets"`
    52  }
    53  
    54  func (GetSecretOutputArgs) ElementType() reflect.Type {
    55  	return reflect.TypeOf((*GetSecretArgs)(nil)).Elem()
    56  }
    57  
    58  // A collection of values returned by getSecret.
    59  type GetSecretResultOutput struct{ *pulumi.OutputState }
    60  
    61  func (GetSecretResultOutput) ElementType() reflect.Type {
    62  	return reflect.TypeOf((*GetSecretResult)(nil)).Elem()
    63  }
    64  
    65  func (o GetSecretResultOutput) ToGetSecretResultOutput() GetSecretResultOutput {
    66  	return o
    67  }
    68  
    69  func (o GetSecretResultOutput) ToGetSecretResultOutputWithContext(ctx context.Context) GetSecretResultOutput {
    70  	return o
    71  }
    72  
    73  // The provider-assigned unique ID for this managed resource.
    74  func (o GetSecretResultOutput) Id() pulumi.StringOutput {
    75  	return o.ApplyT(func(v GetSecretResult) string { return v.Id }).(pulumi.StringOutput)
    76  }
    77  
    78  func (o GetSecretResultOutput) Secrets() GetSecretSecretArrayOutput {
    79  	return o.ApplyT(func(v GetSecretResult) []GetSecretSecret { return v.Secrets }).(GetSecretSecretArrayOutput)
    80  }
    81  
    82  func init() {
    83  	pulumi.RegisterOutputType(GetSecretResultOutput{})
    84  }