Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

AWS SAM Deployment

Payton Garland edited this page Jan 4, 2019 · 3 revisions

cloudfront-auth now supports deployment with AWS' Serverless Application Model.

  1. Install the AWS SAM CLI
  2. Navigate to your root project directory. In template.yaml, modify the CodeUri under the CloudFrontAuthFunction resource. Replace {distribution name} with the proper value.
    CloudFrontAuthFunction:
        Type: AWS::Serverless::Function
        Properties:
          CodeUri: distributions/{distribution name}/
          Role: !GetAtt LambdaEdgeFunctionRole.Arn
          Runtime: nodejs6.10
          Handler: index.handler
          Timeout: 5
          AutoPublishAlias: LIVE
  1. Run the following sequence of commands. If necessary, specify the AWS profile and/or region with the --region and --profile options.
    1. sam build --use-container
    2. sam package --output-template-file packaged.yaml --s3-bucket bucket-name
    3. sam deploy --template-file packaged.yaml --stack-name stack-name --capabilities CAPABILITY_IAM

For more information on AWS SAM deployment, see the hello-world example

Clone this wiki locally