alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

Will withAutoCreateTable(true) always try to create a table? #707

Open TommyQu opened 2 years ago

TommyQu commented 2 years ago

We found a bunch of errors in our cloudtrail event as below, seems some processes are trying to create an existing table constantly.

 "eventTime": "2022-02-07T01:45:48Z",
    "eventSource": "dynamodb.amazonaws.com",
    "eventName": "CreateTable",
    "awsRegion": "us-east-1",
    "userAgent": "aws-sdk-nodejs/2.1001.0 linux/v12.22.7 exec-env/AWS_Lambda_nodejs12.x callback",
    "errorCode": "ResourceInUseException",
    "errorMessage": "Table already exists: xxx",

In index.js, we are doing something like below

exports.handler = Alexa.SkillBuilders.standard()
--
  | .addRequestHandlers(...IntentHandlers, ...AudioIntentHandlers)
  | .addErrorHandlers(ErrorHandler)
  | .addRequestInterceptors(...Interceptors.request)
  | .addResponseInterceptors(...Interceptors.response)
  | .withSkillId(constants.SKILL_ID)
  | .withTableName(constants.xxx)
  | .withAutoCreateTable(true)
  | .lambda();

I'm wondering will withAutoCreateTable(true) always try to create a table even if it exists? So it will throw ResourceInUseException as above that will be shown in Lambda function's error metric?

TommyQu commented 2 years ago

Tested, seems such error won't show in Lambda function's error metric

rahulawl commented 2 years ago

Is this issue/feature-request still relevant? We are working on prioritization of relevant issues and cleanup of rest. If we don’t hear back in 2 weeks, we will assume that the issue is not relevant and we will close it.