title: AWS Lambda: call function from another AWS lambda using boto3 invoke
body: <p>I have simple lambda function that is located under following endpoint:</p>
  
  <p><code>https://******.execute-api.eu-west-2.amazonaws.com/lambda/add?x=1&amp;y=2</code></p>
  
  <p><strong>AWS Chalice</strong> was used for adding simple endpoints here.</p>
  
  <pre><code>@app.route('/{exp}', methods=['GET'])
  def add(exp):
      app.log.debug("Received GET request...")
      request = app.current_request 
      app.log.debug(app.current_request.json_body)
      x = request.query_params['x']
      y = request.query_params['y']
      if exp == 'add':
          app.log.debug("Received ADD command...")
          result = int(x) + int(y)
          return {'add': result}
  </code></pre>
  
  <p>Basically, it checks if the <code>path</code> is equal to <code>add</code> and sums two values from <code>query_params</code>. </p>
  
  <p>Now, I am trying to invoke this lambda in another lambda. </p>
  
  <p><strong>My question:</strong></p>
  
  <p>How I can pass the <code>path</code> and <code>query_params</code> to my original lambda function using boto3 lambda client?</p>
  
  <p>What I have tried so far:</p>
  
  <p>I added two lines to <code>policy.json</code> file that allow me to invoke original function.</p>
  
  <p>I saw a lot of similar question on StackOverflow, but most of them pass payload as a json.</p>
  
  <pre><code>@app.route('/')
  def index():
      lambda_client = boto3.client('lambda')
      invoke_response = lambda_client.invoke(
          FunctionName="function-name",
          InvocationType="RequestResponse"
      )
      app.log.debug(invoke_response['Payload'].read())
  </code></pre>
  
  <p>Thank you in advance!</p>