How to Disable Lambda Temporarily w/ AWS CLI & AWS Console

Updated on
disable lambda temp

Where is the button? There isn’t!

And AWS isn’t sorry!

There are many ways on how you can disable your Lambda for some amount of time, or infinitely (if that’s your wish).

Workaround with Zero Concurrency

The easiest way to disable Lambda invocation for everyone is to set the function concurrency to zero.

This guide will give you an step-by-step tutorial on how to do it with AWS CLI and AWS Console.

Step 1: Find your Lambda

Go to your AWS console Lambda and search for it using the name or ARN.

AWS CLI users can run the command below to list all the lambda functions

aws lambda list-functions --region your-lambda-region

Step 2: Set the Lambda concurrency to zero

Now we make Lambda non-invocable!

With AWS CLI, you can use put-function-concurrency command to update the function’s reserved concurrency.

aws lambda put-function-concurrency --function-name your-function-name --reserved-concurrent-executions 0

After running the command you’ll see the output with:

{
  "ReservedConcurrentExecutions": 0
}

That’s all my friend!

Oh wait, you don’t have AWS CLI?

Here is how to do it with AWS Lambda console:

  • Go to the Function page, e.g. not-a-function.
  • Go to Concurrency tab below Function overview.
  • Click on the Edit button at the right of Concurrency.

lambda-concurrency-config-page

  • Select Reserve concurrency.
  • Type 0 in the input box.
  • Hit Save.

edit-lambda-concurrency

You’ll get to see an error showing Function is throttled:

function-throttled-banner

Remove / Reset Lambda concurrency

Now you’re done with your DDoS experiment and you want to put your Lambda back to the default state.

Use the delete-function-concurrency command to get rid of the concurrency:

aws lambda delete-function-concurrency --function-name your-function-name

For AWS Console users:

Repeat the same step as above to go to Edit concurrency page and set Concurrency to Use unreserved account concurrency.

edit-lambda-concurrency

And don’t forget to hit Save.

If this article helped you, you’ll enjoy these too.


Hills 🏔 and Skills, What's Common?

They both need you to be on top.

You will get lifetime access with:

All yours, just at:

$149

Just type and your search result will magically appear here