ReceiptRule class

Provides an SES receipt rule resource

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// Add a header to the email and store it in S3
const store = new aws.ses.ReceiptRule("store", {
    addHeaderActions: [{
        headerName: "Custom-Header",
        headerValue: "Added by SES",
        position: 1,
    }],
    s3Actions: [{
        bucketName: "emails",
        position: 2,
    }],
    name: "store",
    ruleSetName: "default-rule-set",
    recipients: ["karen@example.com"],
    enabled: true,
    scanEnabled: true,
});
import pulumi
import pulumi_aws as aws

# Add a header to the email and store it in S3
store = aws.ses.ReceiptRule("store",
    add_header_actions=[{
        "header_name": "Custom-Header",
        "header_value": "Added by SES",
        "position": 1,
    }],
    s3_actions=[{
        "bucket_name": "emails",
        "position": 2,
    }],
    name="store",
    rule_set_name="default-rule-set",
    recipients=["karen@example.com"],
    enabled=True,
    scan_enabled=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    // Add a header to the email and store it in S3
    var store = new Aws.Ses.ReceiptRule("store", new()
    {
        AddHeaderActions = new[]
        {
            new Aws.Ses.Inputs.ReceiptRuleAddHeaderActionArgs
            {
                HeaderName = "Custom-Header",
                HeaderValue = "Added by SES",
                Position = 1,
            },
        },
        S3Actions = new[]
        {
            new Aws.Ses.Inputs.ReceiptRuleS3ActionArgs
            {
                BucketName = "emails",
                Position = 2,
            },
        },
        Name = "store",
        RuleSetName = "default-rule-set",
        Recipients = new[]
        {
            "karen@example.com",
        },
        Enabled = true,
        ScanEnabled = true,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ses"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Add a header to the email and store it in S3
		_, err := ses.NewReceiptRule(ctx, "store", &ses.ReceiptRuleArgs{
			AddHeaderActions: ses.ReceiptRuleAddHeaderActionArray{
				&ses.ReceiptRuleAddHeaderActionArgs{
					HeaderName:  pulumi.String("Custom-Header"),
					HeaderValue: pulumi.String("Added by SES"),
					Position:    pulumi.Int(1),
				},
			},
			S3Actions: ses.ReceiptRuleS3ActionArray{
				&ses.ReceiptRuleS3ActionArgs{
					BucketName: pulumi.String("emails"),
					Position:   pulumi.Int(2),
				},
			},
			Name:        pulumi.String("store"),
			RuleSetName: pulumi.String("default-rule-set"),
			Recipients: pulumi.StringArray{
				pulumi.String("karen@example.com"),
			},
			Enabled:     pulumi.Bool(true),
			ScanEnabled: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

# Add a header to the email and store it in S3
resource "aws_ses_receiptrule" "store" {
  add_header_actions {
    header_name  = "Custom-Header"
    header_value = "Added by SES"
    position     = 1
  }
  s3_actions {
    bucket_name = "emails"
    position    = 2
  }
  name          = "store"
  rule_set_name = "default-rule-set"
  recipients    = ["karen@example.com"]
  enabled       = true
  scan_enabled  = true
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ses.ReceiptRule;
import com.pulumi.aws.ses.ReceiptRuleArgs;
import com.pulumi.aws.ses.inputs.ReceiptRuleAddHeaderActionArgs;
import com.pulumi.aws.ses.inputs.ReceiptRuleS3ActionArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        // Add a header to the email and store it in S3
        var store = new ReceiptRule("store", ReceiptRuleArgs.builder()
            .addHeaderActions(ReceiptRuleAddHeaderActionArgs.builder()
                .headerName("Custom-Header")
                .headerValue("Added by SES")
                .position(1)
                .build())
            .s3Actions(ReceiptRuleS3ActionArgs.builder()
                .bucketName("emails")
                .position(2)
                .build())
            .name("store")
            .ruleSetName("default-rule-set")
            .recipients("karen@example.com")
            .enabled(true)
            .scanEnabled(true)
            .build());

    }
}
resources:
  # Add a header to the email and store it in S3
  store:
    type: aws:ses:ReceiptRule
    properties:
      addHeaderActions:
        - headerName: Custom-Header
          headerValue: Added by SES
          position: 1
      s3Actions:
        - bucketName: emails
          position: 2
      name: store
      ruleSetName: default-rule-set
      recipients:
        - karen@example.com
      enabled: true
      scanEnabled: true

Import

Using pulumi import, import SES receipt rules using the ruleset name and rule name separated by :. For example:

$ pulumi import aws:ses/receiptRule:ReceiptRule my_rule my_rule_set:my_rule

Constructors

ReceiptRule(String name, {ReceiptRuleArgs? args, CustomResourceOptions? options})
Creates a new ReceiptRule. name The Pulumi resource name. args Arguments used to configure this ReceiptRule. The set of arguments for ReceiptRule. options Resource options controlling this resource's behavior.
ReceiptRule.reference(String urn)
Creates a typed reference to an existing ReceiptRule resource.

Properties

addHeaderActions ↔ Output<List<ReceiptRuleAddHeaderAction>?>
Configuration block for adding a header to received emails. Detailed below.
latefinal
after ↔ Output<String?>
Name of the rule to place this rule after.
latefinal
arn ↔ Output<String>
SES receipt rule ARN.
latefinal
bounceActions ↔ Output<List<ReceiptRuleBounceAction>?>
Configuration block for rejecting received emails. Detailed below.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
enabled ↔ Output<bool?>
If true, the rule will be enabled.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
lambdaActions ↔ Output<List<ReceiptRuleLambdaAction>?>
Configuration block for calling an AWS Lambda function. Detailed below.
latefinal
name ↔ Output<String>
Name of the rule.
latefinal
recipients ↔ Output<List<String>?>
List of email addresses.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
ruleSetName ↔ Output<String>
Name of the rule set.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
s3Actions ↔ Output<List<ReceiptRuleS3Action>?>
Configuration block for storing received emails in an S3 bucket. Detailed below.
latefinal
scanEnabled ↔ Output<bool?>
If true, incoming emails will be scanned for spam and viruses.
latefinal
snsActions ↔ Output<List<ReceiptRuleSnsAction>?>
Configuration block for publishing to an SNS topic. Detailed below.
latefinal
stopActions ↔ Output<List<ReceiptRuleStopAction>?>
Configuration block for terminating the evaluation of the receipt rule set. Detailed below.
latefinal
tlsPolicy ↔ Output<String>
Require or Optional.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
workmailActions ↔ Output<List<ReceiptRuleWorkmailAction>?>
Configuration block for calling Amazon WorkMail. Detailed below.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ReceiptRuleState? state, CustomResourceOptions? options}) → ReceiptRule
Gets an existing ReceiptRule resource's state with the given name and id.