Class: AWSCDK::LambdaEventSources::S3EventSource
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::LambdaEventSources::S3EventSource
- Includes:
- AWSCDK::Lambda::IEventSource
- Defined in:
- lambda_event_sources/s3_event_source.rb
Overview
Use S3 bucket notifications as an event source for AWS Lambda.
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(target) ⇒ void
Called by
lambda.addEventSourceto allow the event source to bind to this function. - #bucket ⇒ AWSCDK::S3::Bucket
-
#initialize(bucket, props) ⇒ S3EventSource
constructor
A new instance of S3EventSource.
Constructor Details
#initialize(bucket, props) ⇒ S3EventSource
Returns a new instance of S3EventSource.
11 12 13 14 15 16 |
# File 'lambda_event_sources/s3_event_source.rb', line 11 def initialize(bucket, props) props = props.is_a?(Hash) ? ::AWSCDK::LambdaEventSources::S3EventSourceProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuQnVja2V0In0=")), "bucket") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhX2V2ZW50X3NvdXJjZXMuUzNFdmVudFNvdXJjZVByb3BzIn0=")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(bucket, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
18 19 20 21 22 23 |
# File 'lambda_event_sources/s3_event_source.rb', line 18 def self.jsii_overridable_methods { :bucket => { kind: :property, name: "bucket", is_optional: false }, :bind => { kind: :method, name: "bind", is_optional: false }, } end |
Instance Method Details
#bind(target) ⇒ void
This method returns an undefined value.
Called by lambda.addEventSource to allow the event source to bind to this function.
34 35 36 37 |
# File 'lambda_event_sources/s3_event_source.rb', line 34 def bind(target) Jsii::Type.check_type(target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklGdW5jdGlvbiJ9")), "target") jsii_call_method("bind", [target]) end |
#bucket ⇒ AWSCDK::S3::Bucket
26 27 28 |
# File 'lambda_event_sources/s3_event_source.rb', line 26 def bucket() jsii_get_property("bucket") end |