Hi folks,
I’m trying to create a CloudFront function with
aws.cloudfront.Function
from
@pulumi/aws
When I then try to pass the function ARN to the CloudFront distribution, I get error:
Copy code
InvalidLambdaFunctionAssociation: The function ARN must reference a specific function version. (The ARN must end with the version number.)
I set to the function
publish: true
so that it gets published automatically.
But I don’t see where to take the latest version number. Any clue?
I checked also the native provider, but also no luck there.
It seems that without the version number I can’t connect the function to any distribution, which seems quite odd to me.
How is it supposed to be done? 🙂
l
little-cartoon-10569
03/17/2025, 10:30 PM
You're creating a CloudFront function but then associating it as a Lambda function? That doesn't sound right. Are you using the
lambdaFunctionAssociations
property? If you are, try using the
functionAssociations
property instead.
little-cartoon-10569
03/17/2025, 10:31 PM
And if you're trying to associate a lambda function, then you might want to look at
aws.lambda.Function
.
l
lively-mouse-65447
03/17/2025, 10:56 PM
I see! Thanks, this could be the root cause. I will check.
lively-mouse-65447
03/18/2025, 8:57 AM
You were right @little-cartoon-10569, thanks 🙂
I didn’t notice in the code editor that there are two different options
•
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.