Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 Notification to an Aliased Lambda? #128

Closed
RAbraham opened this issue May 4, 2017 · 5 comments
Closed

S3 Notification to an Aliased Lambda? #128

RAbraham opened this issue May 4, 2017 · 5 comments

Comments

@RAbraham
Copy link

RAbraham commented May 4, 2017

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.

@sanathkr
Copy link
Contributor

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.

@jfuss
Copy link
Contributor

jfuss commented Jan 21, 2018

@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

@jfuss jfuss closed this as completed Jan 21, 2018
@RAbraham
Copy link
Author

Thanks!

@smber1
Copy link

smber1 commented Jul 8, 2018

Awesome, was wondering just this!

@sharabash
Copy link

"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"...

hawflau added a commit that referenced this issue Apr 6, 2022
* feat: Support for Lambda URL (#86)

* feat: changed CorsConfig property to Cors (#89)

* feat: add list of "unreleased" properties (#91)

This change hides the unreleased properties from the "Globals" error message

* Lambda URL integ test (#94)

* remove functionUrlConfig from the unrelease properties (#97)

* remove functionUrlConfig from the unrelease properties

* updates

* Function Url new changes  (#109)

* update to Function Url

* first update

* reverted to support autopublishing and added validation for AuthType values

* adding Integration test

* fix: fix paths IF intrinsic bug (#107)

* fix: fix paths IF intrinsic bug

* missed bit of code

* add NoValue tests

* review feedback and refactoring

* naming fix

* review feedback naming and comments

* add missing test + add extra check for api key on tests

* integration test updated (#122)

Co-authored-by: jonife <79116465+jonife@users.noreply.github.com>
Co-authored-by: Renato Valenzuela <37676028+valerena@users.noreply.github.com>
Co-authored-by: Ruperto Torres <86501267+torresxb1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants