Hi folks, I’m trying to create a CloudFront funct...
# aws
l
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
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.
And if you're trying to associate a lambda function, then you might want to look at
aws.lambda.Function
.
l
I see! Thanks, this could be the root cause. I will check.
You were right @little-cartoon-10569, thanks 🙂 I didn’t notice in the code editor that there are two different options •
functionAssociations
lambdaFunctionAssociations