How to temporarily disable an AWS Lambda function using AWS CLI without removing the function
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.
concurrency is set to 0, the function will not run.
1 aws lambda put-function-concurrency --function-name function_name --reserved-concurrent-executions 0
You may also like
- Send event to AWS Lambda when a file is added to an S3 bucket
- How to deploy a Transformer-based model with custom preprocessing code to Sagemaker Endpoints using BentoML
- How to send metrics to AWS CloudWatch from custom Python code
- What is s3:TestEvent, and why does it break my event processing?
- Copy directories in S3 using s3-dist-cp