0

I am new to AWS world and trying to create Lambda@Edge from Github project. I went through the tutorial and could create lambda from AWS console.

Now that I am aware of the basics I wanted to create a GitHub project for lambda handler and deploy it from there.

I went through AWS documentation here. Now I am confused what to do. Lambda@Edge function I created calls to Route 53 domain (which is custom CNAME for API Gateway exposing DynamoDB API). So I feel like I am in the middle which way to go? Is it the best case for SAM or cloud formation?

https://docs.aws.amazon.com/lambda/latest/dg/deploying-lambda-apps.html

1 Answers1

0

I recommending using SAM because you need to update the lambda alias (SAM will do this for you, if you set AutoPublishAlias: live on the SAM function definition, see this example when you deploy a new version.

Agost Biro
  • 2,709
  • 1
  • 20
  • 33
cementblocks
  • 4,326
  • 18
  • 24
  • Thank you for the link. This is really helpful. I want to create 3 alias (dev beta prod) any links you could point out? Also dynamodb im working with is multi regional. So I ended up creating letency enabled route 53 CName for single URL access from lambda. –  Aug 29 '18 at 20:29
  • You can determine the region your lambda is running in by looking at the log group available in the context object. You can then map in your code to the nearest region with your dynamodb tables. – cementblocks Aug 29 '18 at 21:05
  • I would not use lambda aliases for dev beta and prod stages. Just use a different function name and different cloudfront distro for each. – cementblocks Aug 29 '18 at 21:05