awssesactions

package
v1.155.0-devpreview Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddHeader_Override

func NewAddHeader_Override(a AddHeader, props *AddHeaderProps)

Experimental.

func NewBounceTemplate_Override

func NewBounceTemplate_Override(b BounceTemplate, props *BounceTemplateProps)

Experimental.

func NewBounce_Override

func NewBounce_Override(b Bounce, props *BounceProps)

Experimental.

func NewLambda_Override

func NewLambda_Override(l Lambda, props *LambdaProps)

Experimental.

func NewS3_Override

func NewS3_Override(s S3, props *S3Props)

Experimental.

func NewSns_Override

func NewSns_Override(s Sns, props *SnsProps)

Experimental.

func NewStop_Override

func NewStop_Override(s Stop, props *StopProps)

Experimental.

Types

type AddHeader

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

Adds a header to the received email.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"import actions "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,
				}),
			},
		},
	},
})

Experimental.

func NewAddHeader

func NewAddHeader(props *AddHeaderProps) AddHeader

Experimental.

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.
	// Experimental.
	Name *string `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").
	// Experimental.
	Value *string `json:"value" yaml:"value"`
}

Construction properties for a add header action.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"import actions "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,
				}),
			},
		},
	},
})

Experimental.

type Bounce

type Bounce interface {
	awsses.IReceiptRuleAction
	// Returns the receipt rule action specification.
	// Experimental.
	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:

import awscdk "github.com/aws/aws-cdk-go/awscdk"import ses_actions "github.com/aws/aws-cdk-go/awscdk/aws_ses_actions"import awscdk "github.com/aws/aws-cdk-go/awscdk"import sns "github.com/aws/aws-cdk-go/awscdk/aws_sns"

var bounceTemplate bounceTemplate
var topic topic
bounce := ses_actions.NewBounce(&bounceProps{
	sender: jsii.String("sender"),
	template: bounceTemplate,

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

Experimental.

func NewBounce

func NewBounce(props *BounceProps) Bounce

Experimental.

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.
	// Experimental.
	Sender *string `json:"sender" yaml:"sender"`
	// The template containing the message, reply code and status code.
	// Experimental.
	Template BounceTemplate `json:"template" yaml:"template"`
	// The SNS topic to notify when the bounce action is taken.
	// Experimental.
	Topic awssns.ITopic `json:"topic" yaml:"topic"`
}

Construction properties for a bounce action.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"import ses_actions "github.com/aws/aws-cdk-go/awscdk/aws_ses_actions"import awscdk "github.com/aws/aws-cdk-go/awscdk"import sns "github.com/aws/aws-cdk-go/awscdk/aws_sns"

var bounceTemplate bounceTemplate
var topic topic
bounceProps := &bounceProps{
	sender: jsii.String("sender"),
	template: bounceTemplate,

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

Experimental.

type BounceTemplate

type BounceTemplate interface {
	// Experimental.
	Props() *BounceTemplateProps
}

A bounce template.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"import ses_actions "github.com/aws/aws-cdk-go/awscdk/aws_ses_actions"
bounceTemplate := ses_actions.bounceTemplate_MAILBOX_DOES_NOT_EXIST()

Experimental.

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

Experimental.

type BounceTemplateProps

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

Construction properties for a BounceTemplate.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"import ses_actions "github.com/aws/aws-cdk-go/awscdk/aws_ses_actions"
bounceTemplateProps := &bounceTemplateProps{
	message: jsii.String("message"),
	smtpReplyCode: jsii.String("smtpReplyCode"),

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

Experimental.

type EmailEncoding

type EmailEncoding string

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

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

type Lambda

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

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

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"import lambda "github.com/aws/aws-cdk-go/awscdk/aws_lambda"import awscdk "github.com/aws/aws-cdk-go/awscdk"import ses_actions "github.com/aws/aws-cdk-go/awscdk/aws_ses_actions"import awscdk "github.com/aws/aws-cdk-go/awscdk"import sns "github.com/aws/aws-cdk-go/awscdk/aws_sns"

var function_ function
var topic topic
lambda := ses_actions.NewLambda(&lambdaProps{
	function: function_,

	// the properties below are optional
	invocationType: ses_actions.lambdaInvocationType_EVENT,
	topic: topic,
})

Experimental.

func NewLambda

func NewLambda(props *LambdaProps) Lambda

Experimental.

type LambdaInvocationType

type LambdaInvocationType string

The type of invocation to use for a Lambda Action. Experimental.

const (
	// The function will be invoked asynchronously.
	// Experimental.
	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.
	// Experimental.
	LambdaInvocationType_REQUEST_RESPONSE LambdaInvocationType = "REQUEST_RESPONSE"
)

type LambdaProps

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

Construction properties for a Lambda action.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"import lambda "github.com/aws/aws-cdk-go/awscdk/aws_lambda"import awscdk "github.com/aws/aws-cdk-go/awscdk"import ses_actions "github.com/aws/aws-cdk-go/awscdk/aws_ses_actions"import awscdk "github.com/aws/aws-cdk-go/awscdk"import sns "github.com/aws/aws-cdk-go/awscdk/aws_sns"

var function_ function
var topic topic
lambdaProps := &lambdaProps{
	function: function_,

	// the properties below are optional
	invocationType: ses_actions.lambdaInvocationType_EVENT,
	topic: topic,
}

Experimental.

type S3

type S3 interface {
	awsses.IReceiptRuleAction
	// Returns the receipt rule action specification.
	// Experimental.
	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 actions "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,
				}),
			},
		},
	},
})

Experimental.

func NewS3

func NewS3(props *S3Props) S3

Experimental.

type S3Props

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

Construction properties for a S3 action.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"import actions "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,
				}),
			},
		},
	},
})

Experimental.

type Sns

type Sns interface {
	awsses.IReceiptRuleAction
	// Returns the receipt rule action specification.
	// Experimental.
	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 actions "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,
				}),
			},
		},
	},
})

Experimental.

func NewSns

func NewSns(props *SnsProps) Sns

Experimental.

type SnsProps

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

Construction properties for a SNS action.

Example:

import s3 "github.com/aws/aws-cdk-go/awscdk"import actions "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,
				}),
			},
		},
	},
})

Experimental.

type Stop

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

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

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"import ses_actions "github.com/aws/aws-cdk-go/awscdk/aws_ses_actions"import awscdk "github.com/aws/aws-cdk-go/awscdk"import sns "github.com/aws/aws-cdk-go/awscdk/aws_sns"

var topic topic
stop := ses_actions.NewStop(&stopProps{
	topic: topic,
})

Experimental.

func NewStop

func NewStop(props *StopProps) Stop

Experimental.

type StopProps

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

Construction properties for a stop action.

Example:

import awscdk "github.com/aws/aws-cdk-go/awscdk"import ses_actions "github.com/aws/aws-cdk-go/awscdk/aws_ses_actions"import awscdk "github.com/aws/aws-cdk-go/awscdk"import sns "github.com/aws/aws-cdk-go/awscdk/aws_sns"

var topic topic
stopProps := &stopProps{
	topic: topic,
}

Experimental.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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