title: Putting to local DynamoDB table with Python boto3 times out
body: <p>I am attempting to programmatically put data into a locally running DynamoDB Container by triggering a Python lambda expression. </p>
  
  <p>I'm trying to follow the template provided here: <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Python.03.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Python.03.html</a>
  I am using the amazon/dynamodb-local you can download here: <a href="https://hub.docker.com/r/amazon/dynamodb-local" rel="nofollow noreferrer">https://hub.docker.com/r/amazon/dynamodb-local</a></p>
  
  <p>Using Ubuntu 18.04.2 LTS to run the container and lambda server
  AWS Sam CLI to run my Lambda api
  Docker Version 18.09.4
  Python 3.6 (You can see this in sam logs below)
  Startup command for python lambda is just "sam local start-api"</p>
  
  <p>First my Lambda Code</p>
  
  <pre><code>import json
  import boto3
  
  def lambda_handler(event, context):
      print("before grabbing dynamodb")
  #    dynamodb = boto3.resource('dynamodb', endpoint_url="http://localhost:8000",region_name='us-west-2',AWS_ACCESS_KEY_ID='RANDOM',AWS_SECRET_ACCESS_KEY='RANDOM')
      dynamodb = boto3.resource('dynamodb', endpoint_url="http://localhost:8000")
      table = dynamodb.Table('ContactRequests')
      try:
          response = table.put_item(
              Item={
                  'id': "1234",
                  'name': "test user",
                  'email': "testEmail@gmail.com"
                  }
              )
  
      print("response: " + str(response))
  
      return {
          "statusCode": 200,
          "body": json.dumps({
              "message": "hello world"
          }),
      }
  </code></pre>
  
  <p>I know that I should have this table ContactRequests available at localhost:8000, because I can run this script to view my docker container dynamodb tables
  I have tested this with a variety of values in the boto.resource call to include the access keys, region names, and secret keys, with no improvement to result</p>
  
  <pre><code>dev@ubuntu:~/Projects$ aws dynamodb list-tables --endpoint-url http://localhost:8000
  {
      "TableNames": [
          "ContactRequests"
      ]
  }
  </code></pre>
  
  <p>I am also able to successfully hit the localhost:8000/shell that dynamodb offers</p>
  
  <p>Unfortunately while running, if I hit the endpoint that triggers this method, I get a timeout that logs like so</p>
  
  <pre><code>Fetching lambci/lambda:python3.6 Docker container image......
  2019-04-09 15:52:08 Mounting /home/dev/Projects/sam-app/.aws-sam/build/HelloWorldFunction as /var/task:ro inside runtime container
  2019-04-09 15:52:12 Function 'HelloWorldFunction' timed out after 3 seconds
  2019-04-09 15:52:13 Function returned an invalid response (must include one of: body, headers or statusCode in the response object). Response received: 
  2019-04-09 15:52:13 127.0.0.1 - - [09/Apr/2019 15:52:13] "GET /hello HTTP/1.1" 502 -
  </code></pre>
  
  <p>Notice that none of my print methods are being triggered, if I remove the call to table.put, then the print methods are successfully called. </p>
  
  <p>I've seen similar questions on Stack Overflow such as this <a href="https://stackoverflow.com/questions/44034289/lambda-python-dynamodb-write-gets-timeout-error">lambda python dynamodb write gets timeout error</a> that state that the problem is I am using a local db, but shouldn't I still be able to write to a local db with boto3, if I point it to my locally running dynamodb instance?</p>