Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

Amazon Simple Storage Service NotificationConfiguration LambdaConfigurations

LambdaConfigurations is a property of the Amazon S3 NotificationConfiguration property that describes the AWS Lambda (Lambda) functions to invoke and the events for which to invoke them.

Syntax

JSON

Copy
{ "Event" : String, "Filter" : Filter, "Function" : String }

YAML

Copy
Event: String Filter: Filter Function: String

Properties

Event

The S3 bucket event for which to invoke the Lambda function. For more information, see Supported Event Types in the Amazon Simple Storage Service Developer Guide.

Required: Yes

Type: String

Filter

The filtering rules that determine which objects invoke the Lambda function. For example, you can create a filter so that only image files with a .jpg extension invoke the function when they are added to the S3 bucket.

Required: No

Type: Amazon S3 NotificationConfiguration Config Filter

Function

The Amazon Resource Name (ARN) of the Lambda function that Amazon S3 invokes when the specified event type occurs.

Required: Yes

Type: String

Example

The following example creates a NotificationConfiguration for Lambda using an S3 bucket named EncryptionServiceBucket.

Note

The BucketName is unique and the Value contains a file extension without a period (.).

JSON

Copy
"EncryptionServiceBucket" : { "Type" : "AWS::S3::Bucket", "Properties" : { "BucketName" : { "Fn::Sub" : "${User}-encryption-service" }, "NotificationConfiguration" : { "LambdaConfigurations" : [{ "Function" : { "Ref" : "LambdaDeploymentArn" }, "Event" : "s3:ObjectCreated:*", "Filter" : { "S3Key" : { "Rules" : [{ "Name" : "suffix", "Value" : "zip" }] } } }] } } }

YAML

Copy
EncryptionServiceBucket: Type: "AWS::S3::Bucket" Properties: BucketName: !Sub ${User}-encryption-service NotificationConfiguration: LambdaConfigurations: - Function: !Ref LambdaDeploymentArn Event: "s3:ObjectCreated:*" Filter: S3Key: Rules: - Name: suffix Value: zip

On this page: