Closed SHESA-AmitBar closed 2 years ago
I think you can just do the following to do this natively within AWS SAM:
Specify the lambda resource
LambdaFunction: Type: AWS::Serverless::Function Properties: CodeUri: lambdas/ FunctionName: !Ref RedirectLambdaName Handler: RedirectLambda.handler Role: !GetAtt RedirectLambdaFunctionRole.Arn Runtime: nodejs12.x AutoPublishAlias: live
Then in the CloudFront resource, for the lambda function arn:
LambdaFunctionARN: !Ref LambdaFunction.Version
You may not realize this, but this plugin has nothing to do with SAM. This plugin is for the Serverless framework.
I think you can just do the following to do this natively within AWS SAM:
Specify the lambda resource
Then in the CloudFront resource, for the lambda function arn: