Class: AWSCDK::SES::CfnReceiptRule::LambdaActionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ses/cfn_receipt_rule.rb

Overview

When included in a receipt rule, this action calls an AWS Lambda function and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).

To enable Amazon SES to call your AWS Lambda function or to publish to an Amazon SNS topic of another account, Amazon SES must have permission to access those resources. For information about giving permissions, see the Amazon SES Developer Guide .

For information about using AWS Lambda actions in receipt rules, see the Amazon SES Developer Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(function_arn:, invocation_type: nil, topic_arn: nil) ⇒ LambdaActionProperty

Returns a new instance of LambdaActionProperty.

Parameters:

  • function_arn (String)

    The Amazon Resource Name (ARN) of the AWS Lambda function.

  • invocation_type (String, nil) (defaults to: nil)

    The invocation type of the AWS Lambda function.

  • topic_arn (String, nil) (defaults to: nil)

    The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the Lambda action is executed.



819
820
821
822
823
824
825
826
# File 'ses/cfn_receipt_rule.rb', line 819

def initialize(function_arn:, invocation_type: nil, topic_arn: nil)
  @function_arn = function_arn
  Jsii::Type.check_type(@function_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "functionArn")
  @invocation_type = invocation_type
  Jsii::Type.check_type(@invocation_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "invocationType") unless @invocation_type.nil?
  @topic_arn = topic_arn
  Jsii::Type.check_type(@topic_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "topicArn") unless @topic_arn.nil?
end

Instance Attribute Details

#function_arnString (readonly)

The Amazon Resource Name (ARN) of the AWS Lambda function.

An example of an AWS Lambda function ARN is arn:aws:lambda:us-west-2:account-id:function:MyFunction . For more information about AWS Lambda, see the AWS Lambda Developer Guide .



834
835
836
# File 'ses/cfn_receipt_rule.rb', line 834

def function_arn
  @function_arn
end

#invocation_typeString? (readonly)

The invocation type of the AWS Lambda function.

An invocation type of RequestResponse means that the execution of the function immediately results in a response, and a value of Event means that the function is invoked asynchronously. The default value is Event . For information about AWS Lambda invocation types, see the AWS Lambda Developer Guide .

There is a 30-second timeout on RequestResponse invocations. You should use Event invocation in most cases. Use RequestResponse only to make a mail flow decision, such as whether to stop the receipt rule or the receipt rule set.



843
844
845
# File 'ses/cfn_receipt_rule.rb', line 843

def invocation_type
  @invocation_type
end

#topic_arnString? (readonly)

The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the Lambda action is executed.

You can find the ARN of a topic by using the ListTopics operation in Amazon SNS.

For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .



852
853
854
# File 'ses/cfn_receipt_rule.rb', line 852

def topic_arn
  @topic_arn
end

Class Method Details

.jsii_propertiesObject



854
855
856
857
858
859
860
# File 'ses/cfn_receipt_rule.rb', line 854

def self.jsii_properties
  {
    :function_arn => "functionArn",
    :invocation_type => "invocationType",
    :topic_arn => "topicArn",
  }
end

Instance Method Details

#to_jsiiObject



862
863
864
865
866
867
868
869
870
# File 'ses/cfn_receipt_rule.rb', line 862

def to_jsii
  result = {}
  result.merge!({
    "functionArn" => @function_arn,
    "invocationType" => @invocation_type,
    "topicArn" => @topic_arn,
  })
  result.compact
end