title: How to configure timeout when getting items from DynamoDB
body: <p>I want to put a timeout when getting an item from the DynamoDB in Go. I tried to provide the http.Client with 500ms timeout, but it did not work.</p>
  <p>Here's how I configured the Timeout. But when I use <code>GetItem</code> and it was hanging there.</p>
  <pre><code>func LocalDynamo() *dynamodb.DynamoDB {
      creds := credentials.NewStaticCredentials(&quot;123&quot;, &quot;123&quot;, &quot;&quot;)
      awsConfig := &amp;aws.Config{
          Credentials: creds,
          Region:      aws.String(&quot;us-east-1&quot;),
          Endpoint:    aws.String(&quot;http://127.0.0.1:8001&quot;),
          HTTPClient: &amp;http.Client{
              Timeout: 500 * time.Millisecond,
          },
      }
      awsSession := session.Must(session.NewSession(awsConfig))
      return dynamodb.New(awsSession)
  }
  </code></pre>