title: AWS lambda CLI 'update-function-code' does not update lambda_handler file
body: <p><a href="https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-code.html" rel="noreferrer">update-function-code</a> AWS CLI command updates all code files except the handler function file, <code>lambda_function.py</code></p>
  
  <p>Specifically, I made a bash script that</p>
  
  <ol>
  <li>Downloads code zip from one lambda (source)</li>
  <li>Uploads code zip to another lambda (dest)</li>
  </ol>
  
  <p>Everything works, except the main function file <code>lambda_function.py</code> does not get updated.</p>
  
  <p>Oddly, when I download the zip from a lambda, make a change, and then upload to the same lambda, it works (all files are updated).</p>
  
  <p>FYI, here is my bash script to download code from one lambda, and upload to another:</p>
  
  <pre><code>#!/bin/sh
  
  SRC_LAMBDA_FUNCTION_NAME="$1"
  DEST_LAMBDA_FUNCTION_NAME="$2"
  
  export PYTHONIOENCODING=utf8
  
  # get lambda function config
  LAMBDA_JSON=$(aws lambda get-function --function-name $SRC_LAMBDA_FUNCTION_NAME)
  export LAMBDA_JSON
  
  # parse the code zip file download URL (link expires 10 minutes after creation)
  ZIP_FILE_URL=$(python -c 'import json,sys,os;obj=json.loads(os.environ["LAMBDA_JSON"]);print(obj["Code"]["Location"])')
  
  # make temp dir
  mkdir -p download
  
  # download the code from src lambda
  curl -o "download/$SRC_LAMBDA_FUNCTION_NAME.zip" $ZIP_FILE_URL
  
  # upload the code to dest lambda
  aws lambda update-function-code --function-name $DEST_LAMBDA_FUNCTION_NAME --zip-file "fileb://download/$SRC_LAMBDA_FUNCTION_NAME.zip"
  </code></pre>