awssesactions

package
v2.79.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

Amazon Simple Email Service Actions Library

This module contains integration classes to add action to SES email receiving rules. Instances of these classes should be passed to the rule.addAction() method.

Currently supported are:

See the README of @aws-cdk/aws-ses for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddHeader_Override

func NewAddHeader_Override(a AddHeader, props *AddHeaderProps)

func NewBounceTemplate_Override

func NewBounceTemplate_Override(b BounceTemplate, props *BounceTemplateProps)

func NewBounce_Override

func NewBounce_Override(b Bounce, props *BounceProps)

func NewLambda_Override

func NewLambda_Override(l Lambda, props *LambdaProps)

func NewS3_Override

func NewS3_Override(s S3, props *S3Props)

func NewSns_Override

func NewSns_Override(s Sns, props *SnsProps)

func NewStop_Override

func NewStop_Override(s Stop, props *StopProps)

Types

type AddHeader

type AddHeader interface {
	awsses.IReceiptRuleAction
	// Returns the receipt rule action specification.
	Bind(_rule awsses.IReceiptRule) *awsses.ReceiptRuleActionConfig
}

Adds a header to the received email.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

bucket := s3.NewBucket(this, jsii.String("Bucket"))
topic := sns.NewTopic(this, jsii.String("Topic"))

ses.NewReceiptRuleSet(this, jsii.String("RuleSet"), &ReceiptRuleSetProps{
	Rules: []receiptRuleOptions{
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("hello@aws.com"),
			},
			Actions: []iReceiptRuleAction{
				actions.NewAddHeader(&AddHeaderProps{
					Name: jsii.String("X-Special-Header"),
					Value: jsii.String("aws"),
				}),
				actions.NewS3(&S3Props{
					Bucket: *Bucket,
					ObjectKeyPrefix: jsii.String("emails/"),
					Topic: *Topic,
				}),
			},
		},
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("aws.com"),
			},
			Actions: []*iReceiptRuleAction{
				actions.NewSns(&SnsProps{
					Topic: *Topic,
				}),
			},
		},
	},
})

func NewAddHeader

func NewAddHeader(props *AddHeaderProps) AddHeader

type AddHeaderProps

type AddHeaderProps struct {
	// The name of the header to add.
	//
	// Must be between 1 and 50 characters,
	// inclusive, and consist of alphanumeric (a-z, A-Z, 0-9) characters
	// and dashes only.
	Name *string `field:"required" json:"name" yaml:"name"`
	// The value of the header to add.
	//
	// Must be less than 2048 characters,
	// and must not contain newline characters ("\r" or "\n").
	Value *string `field:"required" json:"value" yaml:"value"`
}

Construction properties for a add header action.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

bucket := s3.NewBucket(this, jsii.String("Bucket"))
topic := sns.NewTopic(this, jsii.String("Topic"))

ses.NewReceiptRuleSet(this, jsii.String("RuleSet"), &ReceiptRuleSetProps{
	Rules: []receiptRuleOptions{
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("hello@aws.com"),
			},
			Actions: []iReceiptRuleAction{
				actions.NewAddHeader(&AddHeaderProps{
					Name: jsii.String("X-Special-Header"),
					Value: jsii.String("aws"),
				}),
				actions.NewS3(&S3Props{
					Bucket: *Bucket,
					ObjectKeyPrefix: jsii.String("emails/"),
					Topic: *Topic,
				}),
			},
		},
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("aws.com"),
			},
			Actions: []*iReceiptRuleAction{
				actions.NewSns(&SnsProps{
					Topic: *Topic,
				}),
			},
		},
	},
})

type Bounce

type Bounce interface {
	awsses.IReceiptRuleAction
	// Returns the receipt rule action specification.
	Bind(_rule awsses.IReceiptRule) *awsses.ReceiptRuleActionConfig
}

Rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon SNS.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var bounceTemplate bounceTemplate
var topic topic

bounce := awscdk.Aws_ses_actions.NewBounce(&BounceProps{
	Sender: jsii.String("sender"),
	Template: bounceTemplate,

	// the properties below are optional
	Topic: topic,
})

func NewBounce

func NewBounce(props *BounceProps) Bounce

type BounceProps

type BounceProps struct {
	// The email address of the sender of the bounced email.
	//
	// This is the address
	// from which the bounce message will be sent.
	Sender *string `field:"required" json:"sender" yaml:"sender"`
	// The template containing the message, reply code and status code.
	Template BounceTemplate `field:"required" json:"template" yaml:"template"`
	// The SNS topic to notify when the bounce action is taken.
	Topic awssns.ITopic `field:"optional" json:"topic" yaml:"topic"`
}

Construction properties for a bounce action.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var bounceTemplate bounceTemplate
var topic topic

bounceProps := &BounceProps{
	Sender: jsii.String("sender"),
	Template: bounceTemplate,

	// the properties below are optional
	Topic: topic,
}

type BounceTemplate

type BounceTemplate interface {
	Props() *BounceTemplateProps
}

A bounce template.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

bounceTemplate := awscdk.Aws_ses_actions.BounceTemplate_MAILBOX_DOES_NOT_EXIST()

func BounceTemplate_MAILBOX_DOES_NOT_EXIST

func BounceTemplate_MAILBOX_DOES_NOT_EXIST() BounceTemplate

func BounceTemplate_MAILBOX_FULL

func BounceTemplate_MAILBOX_FULL() BounceTemplate

func BounceTemplate_MESSAGE_CONTENT_REJECTED

func BounceTemplate_MESSAGE_CONTENT_REJECTED() BounceTemplate

func BounceTemplate_MESSAGE_TOO_LARGE

func BounceTemplate_MESSAGE_TOO_LARGE() BounceTemplate

func BounceTemplate_TEMPORARY_FAILURE

func BounceTemplate_TEMPORARY_FAILURE() BounceTemplate

func NewBounceTemplate

func NewBounceTemplate(props *BounceTemplateProps) BounceTemplate

type BounceTemplateProps

type BounceTemplateProps struct {
	// Human-readable text to include in the bounce message.
	Message *string `field:"required" json:"message" yaml:"message"`
	// The SMTP reply code, as defined by RFC 5321.
	// See: https://tools.ietf.org/html/rfc5321
	//
	SmtpReplyCode *string `field:"required" json:"smtpReplyCode" yaml:"smtpReplyCode"`
	// The SMTP enhanced status code, as defined by RFC 3463.
	// See: https://tools.ietf.org/html/rfc3463
	//
	StatusCode *string `field:"optional" json:"statusCode" yaml:"statusCode"`
}

Construction properties for a BounceTemplate.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

bounceTemplateProps := &BounceTemplateProps{
	Message: jsii.String("message"),
	SmtpReplyCode: jsii.String("smtpReplyCode"),

	// the properties below are optional
	StatusCode: jsii.String("statusCode"),
}

type EmailEncoding

type EmailEncoding string

The type of email encoding to use for a SNS action.

const (
	// Base 64.
	EmailEncoding_BASE64 EmailEncoding = "BASE64"
	// UTF-8.
	EmailEncoding_UTF8 EmailEncoding = "UTF8"
)

type Lambda

type Lambda interface {
	awsses.IReceiptRuleAction
	// Returns the receipt rule action specification.
	Bind(rule awsses.IReceiptRule) *awsses.ReceiptRuleActionConfig
}

Calls an AWS Lambda function, and optionally, publishes a notification to Amazon SNS.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var function_ function
var topic topic

lambda := awscdk.Aws_ses_actions.NewLambda(&LambdaProps{
	Function: function_,

	// the properties below are optional
	InvocationType: awscdk.*Aws_ses_actions.LambdaInvocationType_EVENT,
	Topic: topic,
})

func NewLambda

func NewLambda(props *LambdaProps) Lambda

type LambdaInvocationType

type LambdaInvocationType string

The type of invocation to use for a Lambda Action.

const (
	// The function will be invoked asynchronously.
	LambdaInvocationType_EVENT LambdaInvocationType = "EVENT"
	// The function will be invoked sychronously.
	//
	// Use RequestResponse only when
	// you want to make a mail flow decision, such as whether to stop the receipt
	// rule or the receipt rule set.
	LambdaInvocationType_REQUEST_RESPONSE LambdaInvocationType = "REQUEST_RESPONSE"
)

type LambdaProps

type LambdaProps struct {
	// The Lambda function to invoke.
	Function awslambda.IFunction `field:"required" json:"function" yaml:"function"`
	// The invocation type of the Lambda function.
	InvocationType LambdaInvocationType `field:"optional" json:"invocationType" yaml:"invocationType"`
	// The SNS topic to notify when the Lambda action is taken.
	Topic awssns.ITopic `field:"optional" json:"topic" yaml:"topic"`
}

Construction properties for a Lambda action.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var function_ function
var topic topic

lambdaProps := &LambdaProps{
	Function: function_,

	// the properties below are optional
	InvocationType: awscdk.Aws_ses_actions.LambdaInvocationType_EVENT,
	Topic: topic,
}

type S3

type S3 interface {
	awsses.IReceiptRuleAction
	// Returns the receipt rule action specification.
	Bind(rule awsses.IReceiptRule) *awsses.ReceiptRuleActionConfig
}

Saves the received message to an Amazon S3 bucket and, optionally, publishes a notification to Amazon SNS.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

bucket := s3.NewBucket(this, jsii.String("Bucket"))
topic := sns.NewTopic(this, jsii.String("Topic"))

ses.NewReceiptRuleSet(this, jsii.String("RuleSet"), &ReceiptRuleSetProps{
	Rules: []receiptRuleOptions{
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("hello@aws.com"),
			},
			Actions: []iReceiptRuleAction{
				actions.NewAddHeader(&AddHeaderProps{
					Name: jsii.String("X-Special-Header"),
					Value: jsii.String("aws"),
				}),
				actions.NewS3(&S3Props{
					Bucket: *Bucket,
					ObjectKeyPrefix: jsii.String("emails/"),
					Topic: *Topic,
				}),
			},
		},
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("aws.com"),
			},
			Actions: []*iReceiptRuleAction{
				actions.NewSns(&SnsProps{
					Topic: *Topic,
				}),
			},
		},
	},
})

func NewS3

func NewS3(props *S3Props) S3

type S3Props

type S3Props struct {
	// The S3 bucket that incoming email will be saved to.
	Bucket awss3.IBucket `field:"required" json:"bucket" yaml:"bucket"`
	// The master key that SES should use to encrypt your emails before saving them to the S3 bucket.
	KmsKey awskms.IKey `field:"optional" json:"kmsKey" yaml:"kmsKey"`
	// The key prefix of the S3 bucket.
	ObjectKeyPrefix *string `field:"optional" json:"objectKeyPrefix" yaml:"objectKeyPrefix"`
	// The SNS topic to notify when the S3 action is taken.
	Topic awssns.ITopic `field:"optional" json:"topic" yaml:"topic"`
}

Construction properties for a S3 action.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

bucket := s3.NewBucket(this, jsii.String("Bucket"))
topic := sns.NewTopic(this, jsii.String("Topic"))

ses.NewReceiptRuleSet(this, jsii.String("RuleSet"), &ReceiptRuleSetProps{
	Rules: []receiptRuleOptions{
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("hello@aws.com"),
			},
			Actions: []iReceiptRuleAction{
				actions.NewAddHeader(&AddHeaderProps{
					Name: jsii.String("X-Special-Header"),
					Value: jsii.String("aws"),
				}),
				actions.NewS3(&S3Props{
					Bucket: *Bucket,
					ObjectKeyPrefix: jsii.String("emails/"),
					Topic: *Topic,
				}),
			},
		},
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("aws.com"),
			},
			Actions: []*iReceiptRuleAction{
				actions.NewSns(&SnsProps{
					Topic: *Topic,
				}),
			},
		},
	},
})

type Sns

type Sns interface {
	awsses.IReceiptRuleAction
	// Returns the receipt rule action specification.
	Bind(_rule awsses.IReceiptRule) *awsses.ReceiptRuleActionConfig
}

Publishes the email content within a notification to Amazon SNS.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

bucket := s3.NewBucket(this, jsii.String("Bucket"))
topic := sns.NewTopic(this, jsii.String("Topic"))

ses.NewReceiptRuleSet(this, jsii.String("RuleSet"), &ReceiptRuleSetProps{
	Rules: []receiptRuleOptions{
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("hello@aws.com"),
			},
			Actions: []iReceiptRuleAction{
				actions.NewAddHeader(&AddHeaderProps{
					Name: jsii.String("X-Special-Header"),
					Value: jsii.String("aws"),
				}),
				actions.NewS3(&S3Props{
					Bucket: *Bucket,
					ObjectKeyPrefix: jsii.String("emails/"),
					Topic: *Topic,
				}),
			},
		},
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("aws.com"),
			},
			Actions: []*iReceiptRuleAction{
				actions.NewSns(&SnsProps{
					Topic: *Topic,
				}),
			},
		},
	},
})

func NewSns

func NewSns(props *SnsProps) Sns

type SnsProps

type SnsProps struct {
	// The SNS topic to notify.
	Topic awssns.ITopic `field:"required" json:"topic" yaml:"topic"`
	// The encoding to use for the email within the Amazon SNS notification.
	Encoding EmailEncoding `field:"optional" json:"encoding" yaml:"encoding"`
}

Construction properties for a SNS action.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

bucket := s3.NewBucket(this, jsii.String("Bucket"))
topic := sns.NewTopic(this, jsii.String("Topic"))

ses.NewReceiptRuleSet(this, jsii.String("RuleSet"), &ReceiptRuleSetProps{
	Rules: []receiptRuleOptions{
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("hello@aws.com"),
			},
			Actions: []iReceiptRuleAction{
				actions.NewAddHeader(&AddHeaderProps{
					Name: jsii.String("X-Special-Header"),
					Value: jsii.String("aws"),
				}),
				actions.NewS3(&S3Props{
					Bucket: *Bucket,
					ObjectKeyPrefix: jsii.String("emails/"),
					Topic: *Topic,
				}),
			},
		},
		&receiptRuleOptions{
			Recipients: []*string{
				jsii.String("aws.com"),
			},
			Actions: []*iReceiptRuleAction{
				actions.NewSns(&SnsProps{
					Topic: *Topic,
				}),
			},
		},
	},
})

type Stop

type Stop interface {
	awsses.IReceiptRuleAction
	// Returns the receipt rule action specification.
	Bind(_rule awsses.IReceiptRule) *awsses.ReceiptRuleActionConfig
}

Terminates the evaluation of the receipt rule set and optionally publishes a notification to Amazon SNS.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var topic topic

stop := awscdk.Aws_ses_actions.NewStop(&StopProps{
	Topic: topic,
})

func NewStop

func NewStop(props *StopProps) Stop

type StopProps

type StopProps struct {
	// The SNS topic to notify when the stop action is taken.
	Topic awssns.ITopic `field:"optional" json:"topic" yaml:"topic"`
}

Construction properties for a stop action.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var topic topic

stopProps := &StopProps{
	Topic: topic,
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL