Encountered while deploying a lambda function to CloudFront
- Go to ->
AMI
->Roles
-> Search for the role created by Lambda during the lambda function creation. - Select the role ->
Edit Trust Relationship
- Add
edgelambda.amazonaws.com
underService
property as an array
"Statement": {
"Effect": "Allow",
"Principal": {
"Service": ["lambda.amazonaws.com", "edgelambda.amazonaws.com"]
},
"Action": "sts:AssumeRole"
}
https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-distribution-serve-content/
https://stackoverflow.com/questions/51558615/aws-cloudfront-with-multiple-s3-origins