Show / Hide Table of Contents

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 Using statement 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 Bucket property specifies the S3 bucket name or ARN to subscribe to.

Required: Yes

Type: String

Function

The Function property specifies the Lambda ARN to invoke with the events.

Required: Yes

Type: String

Filters

The Filters property specifies the list of filters for S3 events to subscribe to.

Required: Yes

Type: List of FilterDefinition

Attributes

Result

The Result attribute contains the S3 URL of the bucket.

Type: String

Types

LambdaSharp::S3::Subscription.FilterDefinition

Events

The Events property specifies the list of events to subscribe to.

Required: Yes

Type: List

Prefix

The Prefix property specifies a case-sensitive filter that must match the beginning of the S3 key.

Required: No

Type: String

Suffix

The Suffix property 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
In This Article
Back to top Generated by DocFX