1

我想在我的dev资源组中找到 RDS 实例,我有以下代码:


  const params = {
    GroupName : "dev",
    Filters : [
      {
        Name : "resource-type",
        Values : ["AWS:RDS:DBInstance"]
      }
    ]
  }

  resourcegroups.listGroupResources(params)

但是得到这个:

(node:69536) UnhandledPromiseRejectionWarning: BadRequestException: 1 validation error detected: Value '[AWS:RDS:DBInstance]' at 'filters.1.member.values' failed to satisfy constraint: Member must satisfy constraint: [Member must have length less than or equal to 128, Member must have length greater than or equal to 1, Member must satisfy regular expression pattern: AWS::[a-zA-Z0-9]+::[a-zA-Z0-9]+]
    at Object.extractError (/Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/protocol/json.js:51:27)
    at Request.extractError (/Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
    at Request.callListeners (/Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/request.js:688:14)
    at Request.transition (/Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/dfutschik/ziel/ziel-derrops/node_modules/aws-sdk/lib/request.js:690:12)
(node:69536) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:69536) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
4

1 回答 1

1

好吧,那是愚蠢的应该Values : ["AWS::RDS::DBInstance"]::而不是:

于 2020-07-19T13:22:23.067 回答