Skip to content

Can I trigger lambda@edge by an API call?

0

I would like to run my code using my triggering logic, irrespective of end user request (or response). Any way to do it?

asked a year ago156 views
2 Answers
0

Hello.

We have confirmed that triggers other than CloudFront can be set for Lambda functions for Lambda@Edge as shown below.
a

Also, it can be called from the AWS CLI as shown below, so I think it is possible to execute Lambda@Edge from the API with boto3 etc.

aws lambda invoke --function-name cloudfronttest:1 outputfile.txt
{
    "StatusCode": 200,
    "FunctionError": "Unhandled",
    "ExecutedVersion": "1"
}

By the way, is there any reason not to create another Lambda function?
I think it's easier to manage if you separate Lambda functions by purpose.

EXPERT
answered a year ago
EXPERT
reviewed a year ago
  • Is there a way to control which Edge will be run? If not - is there any logic by which an Edge is selected?

  • "By the way, is there any reason not to create another Lambda function?" What do you mean by this? We need the same application code to be run from different locations.

0

"By the way, is there any reason not to create another Lambda function?" What do you mean by this? We need the same application code to be run from different locations.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.