0

I have a requirement that I need to kill Lambda function X from another function Y, when function state of X remains 'active' for 2 mins.

Using info from following documentation, I can get state of function X using get_function method, but then how to kill it from Y? I couldn't find anything helpful from docs here.

Any help or guidance is appreciated. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.update_function_event_invoke_config

1 Answer 1

1

You can't kill a lambda, but if you need it to stop at 2 minutes you can set the lambda timeout at 2 minutes. It will be stopped for you if it hits that time.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes that is the last resort, but is there no function in boto3 that could kill a Lambda specified? If not kill, can I terminate it using any other workaround?
You can't kill it from the outside, to the best of my knowledge. The timeout should be the first resort. That's what it's there for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.