LambdaSharp::S3::Subscription
The LambdaSharp.S3.Subscriber module defines the LambdaSharp::S3::Subscription resource type, which is automatically used by the LambdaSharp CLI to subscribe Lambda functions to S3 events.
Using
NOTE: the LambdaSharp CLI automatically adds the required
Usingstatement when a Lambda function subscribes to S3 events.
Using:
- Module: LambdaSharp.S3.Subscriber:0.5
Syntax
Type: LambdaSharp::S3::Subscription
Properties:
Bucket: String
Function: String
Filters:
- FilterDefinition
Properties
Bucket-
The
Bucketproperty specifies the S3 bucket name or ARN to subscribe to.Required: Yes
Type: String
Function-
The
Functionproperty specifies the Lambda ARN to invoke with the events.Required: Yes
Type: String
Filters-
The
Filtersproperty specifies the list of filters for S3 events to subscribe to.Required: Yes
Type: List of
FilterDefinition
Attributes
Result-
The
Resultattribute contains the S3 URL of the bucket.Type: String
Types
LambdaSharp::S3::Subscription.FilterDefinition
Events-
The
Eventsproperty specifies the list of events to subscribe to.Required: Yes
Type: List
Prefix-
The
Prefixproperty specifies a case-sensitive filter that must match the beginning of the S3 key.Required: No
Type: String
Suffix-
The
Suffixproperty specifies a case-sensitive filter that must match the end of the S3 key.Required: No
Type: String
Examples
Manually create an S3 event subscription
- Resource: MyBucket
Type: AWS::S3::Bucket
- Function: MyFunction
Memory: 256
Timeout: 30
- Resource: MyBucketSubscription
Type: LambdaSharp::S3::Subscription
Properties:
Bucket: !Ref MyBucket
Function: !RFef MyFunction
Filters:
- Events:
- s3:ObjectCreated:*
Prefix: inbox/
Suffix: .png