---
title: "How to temporarily disable an AWS Lambda function using AWS CLI without removing the function"
description: "Disable an AWS Lambda using AWS CLI"
author: "Bartosz Mikulski"
author_bio: "Principal AI Engineer & MLOps Architect. I bridge the gap between \"it works in a notebook\" and \"it works for 200 million users.\""
author_url: https://mikulskibartosz.name
author_linkedin: https://www.linkedin.com/in/mikulskibartosz/
author_github: https://github.com/mikulskibartosz
canonical_url: https://mikulskibartosz.name/temporarily-disable-aws-lambda-using-aws-cli
---

Occasionally, we must quickly disable an AWS Lambda without removing it. It may happen when we accidentally deploy incorrect code, when a lack of input validation causes it to propagate erroneous data downstream, or when we must disable an application function for safety reasons.

When this happens, we don't need to remove the lambda function or its triggers. That would be a terrible solution because we would have to restore it later, and that may create more bugs. Instead of that, we can use the `concurrency` configuration to prevent the function from running.

If the `concurrency` is set to 0, the function will not run.

```bash
aws lambda put-function-concurrency --function-name function_name --reserved-concurrent-executions 0
```

