AWS CLI check if a lambda function exists


How do I do a one-time check if a lambda function exists via the CLI? I saw this function-exists option –

But it polls every second and returns a failure after 20 failed checks. I only want to check once and fail if it isn’t found. Is there a way to do that?


You can check the exit code of get-function in bash. If the function does not exists it returns exit code 255 else it returns 0 on success.

And you can use it like below:
(paste this in your terminal)

Leave a Reply