github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ses/getEmailIdentity.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 ses
     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  // Retrieve the active SES email identity
    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/ses"
    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 := ses.LookupEmailIdentity(ctx, &ses.LookupEmailIdentityArgs{
    32  //				Email: "awesome@example.com",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupEmailIdentity(ctx *pulumi.Context, args *LookupEmailIdentityArgs, opts ...pulumi.InvokeOption) (*LookupEmailIdentityResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupEmailIdentityResult
    46  	err := ctx.Invoke("aws:ses/getEmailIdentity:getEmailIdentity", 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 getEmailIdentity.
    54  type LookupEmailIdentityArgs struct {
    55  	// Email identity.
    56  	Email string `pulumi:"email"`
    57  }
    58  
    59  // A collection of values returned by getEmailIdentity.
    60  type LookupEmailIdentityResult struct {
    61  	// The ARN of the email identity.
    62  	Arn string `pulumi:"arn"`
    63  	// Email identity.
    64  	Email string `pulumi:"email"`
    65  	// The provider-assigned unique ID for this managed resource.
    66  	Id string `pulumi:"id"`
    67  }
    68  
    69  func LookupEmailIdentityOutput(ctx *pulumi.Context, args LookupEmailIdentityOutputArgs, opts ...pulumi.InvokeOption) LookupEmailIdentityResultOutput {
    70  	return pulumi.ToOutputWithContext(context.Background(), args).
    71  		ApplyT(func(v interface{}) (LookupEmailIdentityResult, error) {
    72  			args := v.(LookupEmailIdentityArgs)
    73  			r, err := LookupEmailIdentity(ctx, &args, opts...)
    74  			var s LookupEmailIdentityResult
    75  			if r != nil {
    76  				s = *r
    77  			}
    78  			return s, err
    79  		}).(LookupEmailIdentityResultOutput)
    80  }
    81  
    82  // A collection of arguments for invoking getEmailIdentity.
    83  type LookupEmailIdentityOutputArgs struct {
    84  	// Email identity.
    85  	Email pulumi.StringInput `pulumi:"email"`
    86  }
    87  
    88  func (LookupEmailIdentityOutputArgs) ElementType() reflect.Type {
    89  	return reflect.TypeOf((*LookupEmailIdentityArgs)(nil)).Elem()
    90  }
    91  
    92  // A collection of values returned by getEmailIdentity.
    93  type LookupEmailIdentityResultOutput struct{ *pulumi.OutputState }
    94  
    95  func (LookupEmailIdentityResultOutput) ElementType() reflect.Type {
    96  	return reflect.TypeOf((*LookupEmailIdentityResult)(nil)).Elem()
    97  }
    98  
    99  func (o LookupEmailIdentityResultOutput) ToLookupEmailIdentityResultOutput() LookupEmailIdentityResultOutput {
   100  	return o
   101  }
   102  
   103  func (o LookupEmailIdentityResultOutput) ToLookupEmailIdentityResultOutputWithContext(ctx context.Context) LookupEmailIdentityResultOutput {
   104  	return o
   105  }
   106  
   107  // The ARN of the email identity.
   108  func (o LookupEmailIdentityResultOutput) Arn() pulumi.StringOutput {
   109  	return o.ApplyT(func(v LookupEmailIdentityResult) string { return v.Arn }).(pulumi.StringOutput)
   110  }
   111  
   112  // Email identity.
   113  func (o LookupEmailIdentityResultOutput) Email() pulumi.StringOutput {
   114  	return o.ApplyT(func(v LookupEmailIdentityResult) string { return v.Email }).(pulumi.StringOutput)
   115  }
   116  
   117  // The provider-assigned unique ID for this managed resource.
   118  func (o LookupEmailIdentityResultOutput) Id() pulumi.StringOutput {
   119  	return o.ApplyT(func(v LookupEmailIdentityResult) string { return v.Id }).(pulumi.StringOutput)
   120  }
   121  
   122  func init() {
   123  	pulumi.RegisterOutputType(LookupEmailIdentityResultOutput{})
   124  }