title: Getting error while accessing AWS DynamoDB from AWS Lambda
body: <p>I am getting the error for following boto3 code in lambda to access dynamo db table through STS credentials.
  The code is below</p>
  
  <pre><code>import boto3
  def lambda_handler(event, context):
  sts_client = boto3.client('sts')
  
  # Call the assume_role method of the STSConnection object and pass the role
  # ARN and a role session name.
  assumedRoleObject = sts_client.assume_role(
      RoleArn="arn:aws:iam::012345678910:role/test_role",
      RoleSessionName="AssumeRoleSession1"
  )
  
  # From the response that contains the assumed role, get the temporary
  # credentials that can be used to make subsequent API calls
  credentials = assumedRoleObject['Credentials'] 
  
  
  dynamoDB = boto3.resource('dynamodb',aws_access_key_id=credentials['AccessKeyId'],aws_secret_access_key=credentials['SecretAccessKey'],aws_session_token=credentials['SessionToken'],)
  test1=dynamoDB.get_available_subresources
  
  table = dynamoDB.Table('Test1')
  
  response = table.get_item(
      Key={
              'Name': 'ABC'
          }
      )
  </code></pre>
  
  <h2>    The error stacktrace is below:</h2>
  
  <pre><code>ResourceNotFoundException: An error occurred (ResourceNotFoundException) when calling the GetItem operation: Requested resource not found
  </code></pre>