Class: AWSCDK::S3Notifications::LambdaDestination

Inherits:
Jsii::Object
  • Object
show all
Includes:
AWSCDK::S3::IBucketNotificationDestination
Defined in:
s3_notifications/lambda_destination.rb

Overview

Use a Lambda function as a bucket notification destination.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fn) ⇒ LambdaDestination

Returns a new instance of LambdaDestination.

Parameters:



10
11
12
13
# File 's3_notifications/lambda_destination.rb', line 10

def initialize(fn)
  Jsii::Type.check_type(fn, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "fn")
  Jsii::Object.instance_method(:initialize).bind(self).call(fn)
end

Class Method Details

.jsii_overridable_methodsObject



15
16
17
18
19
# File 's3_notifications/lambda_destination.rb', line 15

def self.jsii_overridable_methods
  {
    :bind => { kind: :method, name: "bind", is_optional: false },
  }
end

Instance Method Details

#bind(scope, bucket) ⇒ AWSCDK::S3::BucketNotificationDestinationConfig

Registers this resource to receive notifications for the specified bucket.

This method will only be called once for each destination/bucket pair and the result will be cached, so there is no need to implement idempotency in each destination.

Parameters:

Returns:



30
31
32
33
34
# File 's3_notifications/lambda_destination.rb', line 30

def bind(scope, bucket)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19zMy5JQnVja2V0UmVmIn0=")), "bucket")
  jsii_call_method("bind", [scope, bucket])
end