github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ses/receiptRuleSet.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  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides an SES receipt rule set resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ses"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := ses.NewReceiptRuleSet(ctx, "main", &ses.ReceiptRuleSetArgs{
    33  //				RuleSetName: pulumi.String("primary-rules"),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import SES receipt rule sets using the rule set name. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:ses/receiptRuleSet:ReceiptRuleSet my_rule_set my_rule_set_name
    51  // ```
    52  type ReceiptRuleSet struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// SES receipt rule set ARN.
    56  	Arn pulumi.StringOutput `pulumi:"arn"`
    57  	// Name of the rule set.
    58  	RuleSetName pulumi.StringOutput `pulumi:"ruleSetName"`
    59  }
    60  
    61  // NewReceiptRuleSet registers a new resource with the given unique name, arguments, and options.
    62  func NewReceiptRuleSet(ctx *pulumi.Context,
    63  	name string, args *ReceiptRuleSetArgs, opts ...pulumi.ResourceOption) (*ReceiptRuleSet, error) {
    64  	if args == nil {
    65  		return nil, errors.New("missing one or more required arguments")
    66  	}
    67  
    68  	if args.RuleSetName == nil {
    69  		return nil, errors.New("invalid value for required argument 'RuleSetName'")
    70  	}
    71  	opts = internal.PkgResourceDefaultOpts(opts)
    72  	var resource ReceiptRuleSet
    73  	err := ctx.RegisterResource("aws:ses/receiptRuleSet:ReceiptRuleSet", name, args, &resource, opts...)
    74  	if err != nil {
    75  		return nil, err
    76  	}
    77  	return &resource, nil
    78  }
    79  
    80  // GetReceiptRuleSet gets an existing ReceiptRuleSet resource's state with the given name, ID, and optional
    81  // state properties that are used to uniquely qualify the lookup (nil if not required).
    82  func GetReceiptRuleSet(ctx *pulumi.Context,
    83  	name string, id pulumi.IDInput, state *ReceiptRuleSetState, opts ...pulumi.ResourceOption) (*ReceiptRuleSet, error) {
    84  	var resource ReceiptRuleSet
    85  	err := ctx.ReadResource("aws:ses/receiptRuleSet:ReceiptRuleSet", name, id, state, &resource, opts...)
    86  	if err != nil {
    87  		return nil, err
    88  	}
    89  	return &resource, nil
    90  }
    91  
    92  // Input properties used for looking up and filtering ReceiptRuleSet resources.
    93  type receiptRuleSetState struct {
    94  	// SES receipt rule set ARN.
    95  	Arn *string `pulumi:"arn"`
    96  	// Name of the rule set.
    97  	RuleSetName *string `pulumi:"ruleSetName"`
    98  }
    99  
   100  type ReceiptRuleSetState struct {
   101  	// SES receipt rule set ARN.
   102  	Arn pulumi.StringPtrInput
   103  	// Name of the rule set.
   104  	RuleSetName pulumi.StringPtrInput
   105  }
   106  
   107  func (ReceiptRuleSetState) ElementType() reflect.Type {
   108  	return reflect.TypeOf((*receiptRuleSetState)(nil)).Elem()
   109  }
   110  
   111  type receiptRuleSetArgs struct {
   112  	// Name of the rule set.
   113  	RuleSetName string `pulumi:"ruleSetName"`
   114  }
   115  
   116  // The set of arguments for constructing a ReceiptRuleSet resource.
   117  type ReceiptRuleSetArgs struct {
   118  	// Name of the rule set.
   119  	RuleSetName pulumi.StringInput
   120  }
   121  
   122  func (ReceiptRuleSetArgs) ElementType() reflect.Type {
   123  	return reflect.TypeOf((*receiptRuleSetArgs)(nil)).Elem()
   124  }
   125  
   126  type ReceiptRuleSetInput interface {
   127  	pulumi.Input
   128  
   129  	ToReceiptRuleSetOutput() ReceiptRuleSetOutput
   130  	ToReceiptRuleSetOutputWithContext(ctx context.Context) ReceiptRuleSetOutput
   131  }
   132  
   133  func (*ReceiptRuleSet) ElementType() reflect.Type {
   134  	return reflect.TypeOf((**ReceiptRuleSet)(nil)).Elem()
   135  }
   136  
   137  func (i *ReceiptRuleSet) ToReceiptRuleSetOutput() ReceiptRuleSetOutput {
   138  	return i.ToReceiptRuleSetOutputWithContext(context.Background())
   139  }
   140  
   141  func (i *ReceiptRuleSet) ToReceiptRuleSetOutputWithContext(ctx context.Context) ReceiptRuleSetOutput {
   142  	return pulumi.ToOutputWithContext(ctx, i).(ReceiptRuleSetOutput)
   143  }
   144  
   145  // ReceiptRuleSetArrayInput is an input type that accepts ReceiptRuleSetArray and ReceiptRuleSetArrayOutput values.
   146  // You can construct a concrete instance of `ReceiptRuleSetArrayInput` via:
   147  //
   148  //	ReceiptRuleSetArray{ ReceiptRuleSetArgs{...} }
   149  type ReceiptRuleSetArrayInput interface {
   150  	pulumi.Input
   151  
   152  	ToReceiptRuleSetArrayOutput() ReceiptRuleSetArrayOutput
   153  	ToReceiptRuleSetArrayOutputWithContext(context.Context) ReceiptRuleSetArrayOutput
   154  }
   155  
   156  type ReceiptRuleSetArray []ReceiptRuleSetInput
   157  
   158  func (ReceiptRuleSetArray) ElementType() reflect.Type {
   159  	return reflect.TypeOf((*[]*ReceiptRuleSet)(nil)).Elem()
   160  }
   161  
   162  func (i ReceiptRuleSetArray) ToReceiptRuleSetArrayOutput() ReceiptRuleSetArrayOutput {
   163  	return i.ToReceiptRuleSetArrayOutputWithContext(context.Background())
   164  }
   165  
   166  func (i ReceiptRuleSetArray) ToReceiptRuleSetArrayOutputWithContext(ctx context.Context) ReceiptRuleSetArrayOutput {
   167  	return pulumi.ToOutputWithContext(ctx, i).(ReceiptRuleSetArrayOutput)
   168  }
   169  
   170  // ReceiptRuleSetMapInput is an input type that accepts ReceiptRuleSetMap and ReceiptRuleSetMapOutput values.
   171  // You can construct a concrete instance of `ReceiptRuleSetMapInput` via:
   172  //
   173  //	ReceiptRuleSetMap{ "key": ReceiptRuleSetArgs{...} }
   174  type ReceiptRuleSetMapInput interface {
   175  	pulumi.Input
   176  
   177  	ToReceiptRuleSetMapOutput() ReceiptRuleSetMapOutput
   178  	ToReceiptRuleSetMapOutputWithContext(context.Context) ReceiptRuleSetMapOutput
   179  }
   180  
   181  type ReceiptRuleSetMap map[string]ReceiptRuleSetInput
   182  
   183  func (ReceiptRuleSetMap) ElementType() reflect.Type {
   184  	return reflect.TypeOf((*map[string]*ReceiptRuleSet)(nil)).Elem()
   185  }
   186  
   187  func (i ReceiptRuleSetMap) ToReceiptRuleSetMapOutput() ReceiptRuleSetMapOutput {
   188  	return i.ToReceiptRuleSetMapOutputWithContext(context.Background())
   189  }
   190  
   191  func (i ReceiptRuleSetMap) ToReceiptRuleSetMapOutputWithContext(ctx context.Context) ReceiptRuleSetMapOutput {
   192  	return pulumi.ToOutputWithContext(ctx, i).(ReceiptRuleSetMapOutput)
   193  }
   194  
   195  type ReceiptRuleSetOutput struct{ *pulumi.OutputState }
   196  
   197  func (ReceiptRuleSetOutput) ElementType() reflect.Type {
   198  	return reflect.TypeOf((**ReceiptRuleSet)(nil)).Elem()
   199  }
   200  
   201  func (o ReceiptRuleSetOutput) ToReceiptRuleSetOutput() ReceiptRuleSetOutput {
   202  	return o
   203  }
   204  
   205  func (o ReceiptRuleSetOutput) ToReceiptRuleSetOutputWithContext(ctx context.Context) ReceiptRuleSetOutput {
   206  	return o
   207  }
   208  
   209  // SES receipt rule set ARN.
   210  func (o ReceiptRuleSetOutput) Arn() pulumi.StringOutput {
   211  	return o.ApplyT(func(v *ReceiptRuleSet) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   212  }
   213  
   214  // Name of the rule set.
   215  func (o ReceiptRuleSetOutput) RuleSetName() pulumi.StringOutput {
   216  	return o.ApplyT(func(v *ReceiptRuleSet) pulumi.StringOutput { return v.RuleSetName }).(pulumi.StringOutput)
   217  }
   218  
   219  type ReceiptRuleSetArrayOutput struct{ *pulumi.OutputState }
   220  
   221  func (ReceiptRuleSetArrayOutput) ElementType() reflect.Type {
   222  	return reflect.TypeOf((*[]*ReceiptRuleSet)(nil)).Elem()
   223  }
   224  
   225  func (o ReceiptRuleSetArrayOutput) ToReceiptRuleSetArrayOutput() ReceiptRuleSetArrayOutput {
   226  	return o
   227  }
   228  
   229  func (o ReceiptRuleSetArrayOutput) ToReceiptRuleSetArrayOutputWithContext(ctx context.Context) ReceiptRuleSetArrayOutput {
   230  	return o
   231  }
   232  
   233  func (o ReceiptRuleSetArrayOutput) Index(i pulumi.IntInput) ReceiptRuleSetOutput {
   234  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ReceiptRuleSet {
   235  		return vs[0].([]*ReceiptRuleSet)[vs[1].(int)]
   236  	}).(ReceiptRuleSetOutput)
   237  }
   238  
   239  type ReceiptRuleSetMapOutput struct{ *pulumi.OutputState }
   240  
   241  func (ReceiptRuleSetMapOutput) ElementType() reflect.Type {
   242  	return reflect.TypeOf((*map[string]*ReceiptRuleSet)(nil)).Elem()
   243  }
   244  
   245  func (o ReceiptRuleSetMapOutput) ToReceiptRuleSetMapOutput() ReceiptRuleSetMapOutput {
   246  	return o
   247  }
   248  
   249  func (o ReceiptRuleSetMapOutput) ToReceiptRuleSetMapOutputWithContext(ctx context.Context) ReceiptRuleSetMapOutput {
   250  	return o
   251  }
   252  
   253  func (o ReceiptRuleSetMapOutput) MapIndex(k pulumi.StringInput) ReceiptRuleSetOutput {
   254  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ReceiptRuleSet {
   255  		return vs[0].(map[string]*ReceiptRuleSet)[vs[1].(string)]
   256  	}).(ReceiptRuleSetOutput)
   257  }
   258  
   259  func init() {
   260  	pulumi.RegisterInputType(reflect.TypeOf((*ReceiptRuleSetInput)(nil)).Elem(), &ReceiptRuleSet{})
   261  	pulumi.RegisterInputType(reflect.TypeOf((*ReceiptRuleSetArrayInput)(nil)).Elem(), ReceiptRuleSetArray{})
   262  	pulumi.RegisterInputType(reflect.TypeOf((*ReceiptRuleSetMapInput)(nil)).Elem(), ReceiptRuleSetMap{})
   263  	pulumi.RegisterOutputType(ReceiptRuleSetOutput{})
   264  	pulumi.RegisterOutputType(ReceiptRuleSetArrayOutput{})
   265  	pulumi.RegisterOutputType(ReceiptRuleSetMapOutput{})
   266  }