github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sesv2/emailIdentityMailFromAttributes.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 sesv2
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Resource for managing an AWS SESv2 (Simple Email V2) Email Identity Mail From Attributes.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"fmt"
    28  //
    29  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sesv2"
    30  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    31  //
    32  // )
    33  //
    34  //	func main() {
    35  //		pulumi.Run(func(ctx *pulumi.Context) error {
    36  //			example, err := sesv2.NewEmailIdentity(ctx, "example", &sesv2.EmailIdentityArgs{
    37  //				EmailIdentity: pulumi.String("example.com"),
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			_, err = sesv2.NewEmailIdentityMailFromAttributes(ctx, "example", &sesv2.EmailIdentityMailFromAttributesArgs{
    43  //				EmailIdentity:       example.EmailIdentity,
    44  //				BehaviorOnMxFailure: pulumi.String("REJECT_MESSAGE"),
    45  //				MailFromDomain: example.EmailIdentity.ApplyT(func(emailIdentity string) (string, error) {
    46  //					return fmt.Sprintf("subdomain.%v", emailIdentity), nil
    47  //				}).(pulumi.StringOutput),
    48  //			})
    49  //			if err != nil {
    50  //				return err
    51  //			}
    52  //			return nil
    53  //		})
    54  //	}
    55  //
    56  // ```
    57  // <!--End PulumiCodeChooser -->
    58  //
    59  // ## Import
    60  //
    61  // Using `pulumi import`, import SESv2 (Simple Email V2) Email Identity Mail From Attributes using the `email_identity`. For example:
    62  //
    63  // ```sh
    64  // $ pulumi import aws:sesv2/emailIdentityMailFromAttributes:EmailIdentityMailFromAttributes example example.com
    65  // ```
    66  type EmailIdentityMailFromAttributes struct {
    67  	pulumi.CustomResourceState
    68  
    69  	// The action to take if the required MX record isn't found when you send an email. Valid values: `USE_DEFAULT_VALUE`, `REJECT_MESSAGE`.
    70  	BehaviorOnMxFailure pulumi.StringPtrOutput `pulumi:"behaviorOnMxFailure"`
    71  	// The verified email identity.
    72  	EmailIdentity pulumi.StringOutput `pulumi:"emailIdentity"`
    73  	// The custom MAIL FROM domain that you want the verified identity to use. Required if `behaviorOnMxFailure` is `REJECT_MESSAGE`.
    74  	MailFromDomain pulumi.StringPtrOutput `pulumi:"mailFromDomain"`
    75  }
    76  
    77  // NewEmailIdentityMailFromAttributes registers a new resource with the given unique name, arguments, and options.
    78  func NewEmailIdentityMailFromAttributes(ctx *pulumi.Context,
    79  	name string, args *EmailIdentityMailFromAttributesArgs, opts ...pulumi.ResourceOption) (*EmailIdentityMailFromAttributes, error) {
    80  	if args == nil {
    81  		return nil, errors.New("missing one or more required arguments")
    82  	}
    83  
    84  	if args.EmailIdentity == nil {
    85  		return nil, errors.New("invalid value for required argument 'EmailIdentity'")
    86  	}
    87  	opts = internal.PkgResourceDefaultOpts(opts)
    88  	var resource EmailIdentityMailFromAttributes
    89  	err := ctx.RegisterResource("aws:sesv2/emailIdentityMailFromAttributes:EmailIdentityMailFromAttributes", name, args, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // GetEmailIdentityMailFromAttributes gets an existing EmailIdentityMailFromAttributes resource's state with the given name, ID, and optional
    97  // state properties that are used to uniquely qualify the lookup (nil if not required).
    98  func GetEmailIdentityMailFromAttributes(ctx *pulumi.Context,
    99  	name string, id pulumi.IDInput, state *EmailIdentityMailFromAttributesState, opts ...pulumi.ResourceOption) (*EmailIdentityMailFromAttributes, error) {
   100  	var resource EmailIdentityMailFromAttributes
   101  	err := ctx.ReadResource("aws:sesv2/emailIdentityMailFromAttributes:EmailIdentityMailFromAttributes", name, id, state, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // Input properties used for looking up and filtering EmailIdentityMailFromAttributes resources.
   109  type emailIdentityMailFromAttributesState struct {
   110  	// The action to take if the required MX record isn't found when you send an email. Valid values: `USE_DEFAULT_VALUE`, `REJECT_MESSAGE`.
   111  	BehaviorOnMxFailure *string `pulumi:"behaviorOnMxFailure"`
   112  	// The verified email identity.
   113  	EmailIdentity *string `pulumi:"emailIdentity"`
   114  	// The custom MAIL FROM domain that you want the verified identity to use. Required if `behaviorOnMxFailure` is `REJECT_MESSAGE`.
   115  	MailFromDomain *string `pulumi:"mailFromDomain"`
   116  }
   117  
   118  type EmailIdentityMailFromAttributesState struct {
   119  	// The action to take if the required MX record isn't found when you send an email. Valid values: `USE_DEFAULT_VALUE`, `REJECT_MESSAGE`.
   120  	BehaviorOnMxFailure pulumi.StringPtrInput
   121  	// The verified email identity.
   122  	EmailIdentity pulumi.StringPtrInput
   123  	// The custom MAIL FROM domain that you want the verified identity to use. Required if `behaviorOnMxFailure` is `REJECT_MESSAGE`.
   124  	MailFromDomain pulumi.StringPtrInput
   125  }
   126  
   127  func (EmailIdentityMailFromAttributesState) ElementType() reflect.Type {
   128  	return reflect.TypeOf((*emailIdentityMailFromAttributesState)(nil)).Elem()
   129  }
   130  
   131  type emailIdentityMailFromAttributesArgs struct {
   132  	// The action to take if the required MX record isn't found when you send an email. Valid values: `USE_DEFAULT_VALUE`, `REJECT_MESSAGE`.
   133  	BehaviorOnMxFailure *string `pulumi:"behaviorOnMxFailure"`
   134  	// The verified email identity.
   135  	EmailIdentity string `pulumi:"emailIdentity"`
   136  	// The custom MAIL FROM domain that you want the verified identity to use. Required if `behaviorOnMxFailure` is `REJECT_MESSAGE`.
   137  	MailFromDomain *string `pulumi:"mailFromDomain"`
   138  }
   139  
   140  // The set of arguments for constructing a EmailIdentityMailFromAttributes resource.
   141  type EmailIdentityMailFromAttributesArgs struct {
   142  	// The action to take if the required MX record isn't found when you send an email. Valid values: `USE_DEFAULT_VALUE`, `REJECT_MESSAGE`.
   143  	BehaviorOnMxFailure pulumi.StringPtrInput
   144  	// The verified email identity.
   145  	EmailIdentity pulumi.StringInput
   146  	// The custom MAIL FROM domain that you want the verified identity to use. Required if `behaviorOnMxFailure` is `REJECT_MESSAGE`.
   147  	MailFromDomain pulumi.StringPtrInput
   148  }
   149  
   150  func (EmailIdentityMailFromAttributesArgs) ElementType() reflect.Type {
   151  	return reflect.TypeOf((*emailIdentityMailFromAttributesArgs)(nil)).Elem()
   152  }
   153  
   154  type EmailIdentityMailFromAttributesInput interface {
   155  	pulumi.Input
   156  
   157  	ToEmailIdentityMailFromAttributesOutput() EmailIdentityMailFromAttributesOutput
   158  	ToEmailIdentityMailFromAttributesOutputWithContext(ctx context.Context) EmailIdentityMailFromAttributesOutput
   159  }
   160  
   161  func (*EmailIdentityMailFromAttributes) ElementType() reflect.Type {
   162  	return reflect.TypeOf((**EmailIdentityMailFromAttributes)(nil)).Elem()
   163  }
   164  
   165  func (i *EmailIdentityMailFromAttributes) ToEmailIdentityMailFromAttributesOutput() EmailIdentityMailFromAttributesOutput {
   166  	return i.ToEmailIdentityMailFromAttributesOutputWithContext(context.Background())
   167  }
   168  
   169  func (i *EmailIdentityMailFromAttributes) ToEmailIdentityMailFromAttributesOutputWithContext(ctx context.Context) EmailIdentityMailFromAttributesOutput {
   170  	return pulumi.ToOutputWithContext(ctx, i).(EmailIdentityMailFromAttributesOutput)
   171  }
   172  
   173  // EmailIdentityMailFromAttributesArrayInput is an input type that accepts EmailIdentityMailFromAttributesArray and EmailIdentityMailFromAttributesArrayOutput values.
   174  // You can construct a concrete instance of `EmailIdentityMailFromAttributesArrayInput` via:
   175  //
   176  //	EmailIdentityMailFromAttributesArray{ EmailIdentityMailFromAttributesArgs{...} }
   177  type EmailIdentityMailFromAttributesArrayInput interface {
   178  	pulumi.Input
   179  
   180  	ToEmailIdentityMailFromAttributesArrayOutput() EmailIdentityMailFromAttributesArrayOutput
   181  	ToEmailIdentityMailFromAttributesArrayOutputWithContext(context.Context) EmailIdentityMailFromAttributesArrayOutput
   182  }
   183  
   184  type EmailIdentityMailFromAttributesArray []EmailIdentityMailFromAttributesInput
   185  
   186  func (EmailIdentityMailFromAttributesArray) ElementType() reflect.Type {
   187  	return reflect.TypeOf((*[]*EmailIdentityMailFromAttributes)(nil)).Elem()
   188  }
   189  
   190  func (i EmailIdentityMailFromAttributesArray) ToEmailIdentityMailFromAttributesArrayOutput() EmailIdentityMailFromAttributesArrayOutput {
   191  	return i.ToEmailIdentityMailFromAttributesArrayOutputWithContext(context.Background())
   192  }
   193  
   194  func (i EmailIdentityMailFromAttributesArray) ToEmailIdentityMailFromAttributesArrayOutputWithContext(ctx context.Context) EmailIdentityMailFromAttributesArrayOutput {
   195  	return pulumi.ToOutputWithContext(ctx, i).(EmailIdentityMailFromAttributesArrayOutput)
   196  }
   197  
   198  // EmailIdentityMailFromAttributesMapInput is an input type that accepts EmailIdentityMailFromAttributesMap and EmailIdentityMailFromAttributesMapOutput values.
   199  // You can construct a concrete instance of `EmailIdentityMailFromAttributesMapInput` via:
   200  //
   201  //	EmailIdentityMailFromAttributesMap{ "key": EmailIdentityMailFromAttributesArgs{...} }
   202  type EmailIdentityMailFromAttributesMapInput interface {
   203  	pulumi.Input
   204  
   205  	ToEmailIdentityMailFromAttributesMapOutput() EmailIdentityMailFromAttributesMapOutput
   206  	ToEmailIdentityMailFromAttributesMapOutputWithContext(context.Context) EmailIdentityMailFromAttributesMapOutput
   207  }
   208  
   209  type EmailIdentityMailFromAttributesMap map[string]EmailIdentityMailFromAttributesInput
   210  
   211  func (EmailIdentityMailFromAttributesMap) ElementType() reflect.Type {
   212  	return reflect.TypeOf((*map[string]*EmailIdentityMailFromAttributes)(nil)).Elem()
   213  }
   214  
   215  func (i EmailIdentityMailFromAttributesMap) ToEmailIdentityMailFromAttributesMapOutput() EmailIdentityMailFromAttributesMapOutput {
   216  	return i.ToEmailIdentityMailFromAttributesMapOutputWithContext(context.Background())
   217  }
   218  
   219  func (i EmailIdentityMailFromAttributesMap) ToEmailIdentityMailFromAttributesMapOutputWithContext(ctx context.Context) EmailIdentityMailFromAttributesMapOutput {
   220  	return pulumi.ToOutputWithContext(ctx, i).(EmailIdentityMailFromAttributesMapOutput)
   221  }
   222  
   223  type EmailIdentityMailFromAttributesOutput struct{ *pulumi.OutputState }
   224  
   225  func (EmailIdentityMailFromAttributesOutput) ElementType() reflect.Type {
   226  	return reflect.TypeOf((**EmailIdentityMailFromAttributes)(nil)).Elem()
   227  }
   228  
   229  func (o EmailIdentityMailFromAttributesOutput) ToEmailIdentityMailFromAttributesOutput() EmailIdentityMailFromAttributesOutput {
   230  	return o
   231  }
   232  
   233  func (o EmailIdentityMailFromAttributesOutput) ToEmailIdentityMailFromAttributesOutputWithContext(ctx context.Context) EmailIdentityMailFromAttributesOutput {
   234  	return o
   235  }
   236  
   237  // The action to take if the required MX record isn't found when you send an email. Valid values: `USE_DEFAULT_VALUE`, `REJECT_MESSAGE`.
   238  func (o EmailIdentityMailFromAttributesOutput) BehaviorOnMxFailure() pulumi.StringPtrOutput {
   239  	return o.ApplyT(func(v *EmailIdentityMailFromAttributes) pulumi.StringPtrOutput { return v.BehaviorOnMxFailure }).(pulumi.StringPtrOutput)
   240  }
   241  
   242  // The verified email identity.
   243  func (o EmailIdentityMailFromAttributesOutput) EmailIdentity() pulumi.StringOutput {
   244  	return o.ApplyT(func(v *EmailIdentityMailFromAttributes) pulumi.StringOutput { return v.EmailIdentity }).(pulumi.StringOutput)
   245  }
   246  
   247  // The custom MAIL FROM domain that you want the verified identity to use. Required if `behaviorOnMxFailure` is `REJECT_MESSAGE`.
   248  func (o EmailIdentityMailFromAttributesOutput) MailFromDomain() pulumi.StringPtrOutput {
   249  	return o.ApplyT(func(v *EmailIdentityMailFromAttributes) pulumi.StringPtrOutput { return v.MailFromDomain }).(pulumi.StringPtrOutput)
   250  }
   251  
   252  type EmailIdentityMailFromAttributesArrayOutput struct{ *pulumi.OutputState }
   253  
   254  func (EmailIdentityMailFromAttributesArrayOutput) ElementType() reflect.Type {
   255  	return reflect.TypeOf((*[]*EmailIdentityMailFromAttributes)(nil)).Elem()
   256  }
   257  
   258  func (o EmailIdentityMailFromAttributesArrayOutput) ToEmailIdentityMailFromAttributesArrayOutput() EmailIdentityMailFromAttributesArrayOutput {
   259  	return o
   260  }
   261  
   262  func (o EmailIdentityMailFromAttributesArrayOutput) ToEmailIdentityMailFromAttributesArrayOutputWithContext(ctx context.Context) EmailIdentityMailFromAttributesArrayOutput {
   263  	return o
   264  }
   265  
   266  func (o EmailIdentityMailFromAttributesArrayOutput) Index(i pulumi.IntInput) EmailIdentityMailFromAttributesOutput {
   267  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EmailIdentityMailFromAttributes {
   268  		return vs[0].([]*EmailIdentityMailFromAttributes)[vs[1].(int)]
   269  	}).(EmailIdentityMailFromAttributesOutput)
   270  }
   271  
   272  type EmailIdentityMailFromAttributesMapOutput struct{ *pulumi.OutputState }
   273  
   274  func (EmailIdentityMailFromAttributesMapOutput) ElementType() reflect.Type {
   275  	return reflect.TypeOf((*map[string]*EmailIdentityMailFromAttributes)(nil)).Elem()
   276  }
   277  
   278  func (o EmailIdentityMailFromAttributesMapOutput) ToEmailIdentityMailFromAttributesMapOutput() EmailIdentityMailFromAttributesMapOutput {
   279  	return o
   280  }
   281  
   282  func (o EmailIdentityMailFromAttributesMapOutput) ToEmailIdentityMailFromAttributesMapOutputWithContext(ctx context.Context) EmailIdentityMailFromAttributesMapOutput {
   283  	return o
   284  }
   285  
   286  func (o EmailIdentityMailFromAttributesMapOutput) MapIndex(k pulumi.StringInput) EmailIdentityMailFromAttributesOutput {
   287  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EmailIdentityMailFromAttributes {
   288  		return vs[0].(map[string]*EmailIdentityMailFromAttributes)[vs[1].(string)]
   289  	}).(EmailIdentityMailFromAttributesOutput)
   290  }
   291  
   292  func init() {
   293  	pulumi.RegisterInputType(reflect.TypeOf((*EmailIdentityMailFromAttributesInput)(nil)).Elem(), &EmailIdentityMailFromAttributes{})
   294  	pulumi.RegisterInputType(reflect.TypeOf((*EmailIdentityMailFromAttributesArrayInput)(nil)).Elem(), EmailIdentityMailFromAttributesArray{})
   295  	pulumi.RegisterInputType(reflect.TypeOf((*EmailIdentityMailFromAttributesMapInput)(nil)).Elem(), EmailIdentityMailFromAttributesMap{})
   296  	pulumi.RegisterOutputType(EmailIdentityMailFromAttributesOutput{})
   297  	pulumi.RegisterOutputType(EmailIdentityMailFromAttributesArrayOutput{})
   298  	pulumi.RegisterOutputType(EmailIdentityMailFromAttributesMapOutput{})
   299  }