简体   繁体   English

无法在 AWS SDK 中使用 listGroupResources

[英]Cannot use the listGroupResources in AWS SDK

I want to find the RDS instances in my dev resource group, I have the following code:我想在我的dev资源组中找到 RDS 实例,我有以下代码:


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

  resourcegroups.listGroupResources(params)

But get this:但是得到这个:

(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.

Ok that was dumb should be Values: ["AWS::RDS::DBInstance"] with :: instead of :好吧,这很愚蠢应该是Values: ["AWS::RDS::DBInstance"] with ::而不是:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM