Skip to content

InvalidLambdaFunctionAssociation: The function ARN must reference a specific function version #19

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

Closed
juvaly opened this issue Dec 2, 2020 · 1 comment

Comments

@juvaly
Copy link

juvaly commented Dec 2, 2020

I tried following the documentation for the simple case of adding a trigger to an existing CF distribution. During deployment I'm getting this message:

The function ARN must reference a specific function version. (The ARN must end with the version number.)

The ARN that is being set ends with $LATEST which is an alias, and seems to be unsupported by CloudFront:

arn:aws:lambda:eu-central-1:XXXX:function:XXXX-generateSitemap:$LATEST

What am I doing wrong here?
Btw, I get the exact same message if I manually try to set this ARN by editing the CloudFront distribution in the CF console.

@juvaly
Copy link
Author

juvaly commented Dec 2, 2020

In case someone encounters this in the future:

I noticed the plugin code does have a function that looks for the latest version number. However my serverless.yml had this line:

versionFunctions: false

Which always leaves only the $LATEST version. Changing this value to true fixed the problem.

@juvaly juvaly closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant