admin管理员组文章数量:1431912
I've created an AWS::CloudFront::Function using CloudFormation (template here). Then I've tried to associate with a distribution following the LambdaFunctionAssociation docs:
DistributionConfig:
DefaultCacheBehavior:
LambdaFunctionAssociations:
EventType: viewer-request
LambdaFunctionARN: !GetAtt Function_Logical_ID.FunctionMetadata.FunctionARN
And I get the following error: Invalid request provided: The function ARN must reference a specific function version. (The ARN must end with the version number.)
How to associate a CloudFront Function using CloudFormation?
I've created an AWS::CloudFront::Function using CloudFormation (template here). Then I've tried to associate with a distribution following the LambdaFunctionAssociation docs:
DistributionConfig:
DefaultCacheBehavior:
LambdaFunctionAssociations:
EventType: viewer-request
LambdaFunctionARN: !GetAtt Function_Logical_ID.FunctionMetadata.FunctionARN
And I get the following error: Invalid request provided: The function ARN must reference a specific function version. (The ARN must end with the version number.)
How to associate a CloudFront Function using CloudFormation?
Share Improve this question asked Nov 18, 2024 at 21:26 Pedro ArantesPedro Arantes 5,3695 gold badges29 silver badges64 bronze badges1 Answer
Reset to default 1My mistake was that I was using LambdaFunctionAssociations
instead of FunctionAssociations
(docs here):
FunctionAssociations
are for CloudFront functions;LambdaFunctionAssociations
are for Lambda@Edge.
Then I changed to the template below and it worked:
DistributionConfig:
DefaultCacheBehavior:
FunctionAssociations:
EventType: viewer-request
FunctionARN: !GetAtt Function_Logical_ID.FunctionMetadata.FunctionARN
本文标签:
版权声明:本文标题:amazon web services - CloudFront function association - Invalid request provided: The function ARN must reference a specific fun 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745593204a2665320.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论