aws-lambda-edge

Cloudfront Origin Group detect failver using Lambda@Edge

℡╲_俬逩灬. 提交于 2020-01-24 20:55:47
问题 My setup: I have a Cloudfront Origin Group where Bucket A is a primary bucket and Bucket B is a secondary bucket. Lambda@Edge is added on origin-request to do a certain process. Whenever a request comes to Cloudfront, my Lambda@Edge modifies it to match the folder structure of my bucket and returns file accordingly. If Bucket A doesn't have a certain file it throws an error and Cloudfront failover requests the file from Bucket B. Bucket B doesn't have the same structure as Bucket it, it

Adding Lambda@edge includebody field in cloudfront using cloudformation template?

帅比萌擦擦* 提交于 2020-01-06 03:54:22
问题 I am trying to add Lambda@Edge association in cloudfront using cloudformation. As per aws docs they had only two fields like EventType and LambdaFunctionARN . But i want to add IncludeBody in cloudformation so that my Lambda@Edge will read the body of the request . When i try to add IncludeBody in cloudformation it is saying error like invalid property . "LambdaFunctionAssociations": [ { "EventType": "origin-response", "IncludeBody":"true" -- Invalid property error "LambdaFunctionARN": "arn

Debugging the CloudFront's problem after enabling Lambda@Edge

做~自己de王妃 提交于 2019-12-24 18:16:42
问题 Following this article, I'm trying to serve my static content from multiple regions (under the same domain) within AWS. So far, I have: uploaded my content into an S3 bucket enabled the "static web hosting" for that bucket and made it public created a distribution in CloudFront with the S3 bucket as the origin created a record set in Route 53 pointing to the distribution At this point, everything works fine. If I enter the domain name in a browser, I can see the static content. Now it's time

Cloudfront Lambda@edge set cookie on Viewer Request

你说的曾经没有我的故事 提交于 2019-12-20 06:28:04
问题 Update: Collected my thoughts better I'm generating a unique identifier (UUID) for each user in the Viewer Request Lambda, and then selecting a cached page to return based upon that UUID. This works. Ideally, this user would always have the same UUID. I must generate that UUID in the Viewer Request if it is not present in a cookie on that Viewer Request. I also need that UUID to be set as a cookie, which of course happens in the response not the request. Without caching, my server simply

AWS Lambda@Edge debugging

你。 提交于 2019-12-10 02:52:37
问题 I'm currently working on a lambda@edge function. I cannot find any logs on CloudWatch or other debugging options. When running the lambda using the "Test" button, the logs are written to CloudWatch. When the lambda function is triggered by a CloudFront event the logs are not written. I'm 100% positive that the event trigger works, as I can see its result. Any idea how to proceed? Thanks ahead, Yossi 回答1: 1) Ensure you have provided permission for lambda to send logs to cloudwatch. Below is

Cloudfront Lambda@edge set cookie on Viewer Request

旧时模样 提交于 2019-12-02 07:40:05
Update: Collected my thoughts better I'm generating a unique identifier (UUID) for each user in the Viewer Request Lambda, and then selecting a cached page to return based upon that UUID. This works. Ideally, this user would always have the same UUID. I must generate that UUID in the Viewer Request if it is not present in a cookie on that Viewer Request. I also need that UUID to be set as a cookie, which of course happens in the response not the request. Without caching, my server simply handles taking a custom header and creating a Set-Cookie in the response header. I am not finding a way to