Skip to content

S3 Notification to an Aliased Lambda? #128

Closed

Description

@RAbraham

Hi,
My intent is to create an aliased Lambda function and have a S3 bucket configured to invoke the aliased lambda when an object is created in that bucket.

Using AWS::Serverless::Function and the Events subkey, I can configure a non-aliased lambda function to be invoked.

However, I don't know how to make S3 invoke an aliased lambda function using the SAM template. I couldn't find documentation so I am guessing this is a feature request?

I was able to create an alias for my lambda function using AWS::Lambda::Alias but am unable to configure S3 with the ARN of the aliased lambda.

Activity

  1. sanathkr commented on Jun 28, 2017

    @sanathkr

    Create the alias using AWS::Lambda::Alias resource and use !GetAtt <logical-id-of-alias>.Arn in the S3 Event specification to point to the alias.

  2. jfuss commented on Jan 21, 2018

    @jfuss
    Contributor

    @RAbraham This is now the default behavior if you use/set the AutoPublishAlias Property on the AWS::Serverless::Function. Said explicitly, SAM will wire up event sources to the Alias if this field is set, otherwise will connect events to the Lambda Function.

    Resolving since this is now fully supported in SAM

  3. RAbraham commented on Jan 22, 2018

    @RAbraham
    Author

    Thanks!

  4. smber1 commented on Jul 8, 2018

    @smber1

    Awesome, was wondering just this!

  5. sharabash commented on Nov 9, 2018

    @sharabash

    "Create the alias using AWS::Lambda::Alias resource and use !GetAtt .Arn in the S3 Event specification to point to the alias."

    This doesn't make sense. On what property of the S3 Event specification would you set the Arn of the Lambda alias? The documentation only describes 3 possible properties, none of which are relevant:

    https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#s3

    "Bucket," "Events," and "Filter"...

  6. added a commit that references this issue on Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions