silvermine / serverless-plugin-cloudfront-lambda-edge

Adds Lambda@Edge support to Serverless
MIT License
296 stars 41 forks source link

I don't think this is needed #78

Closed SHESA-AmitBar closed 2 years ago

SHESA-AmitBar commented 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
jthomerson commented 2 years ago

You may not realize this, but this plugin has nothing to do with SAM. This plugin is for the Serverless framework.