Облачная информация awssdk Недостаточное исключение CapabilitiesException: Требуются возможности: [CAPABILITY_IAM] - PullRequest
0 голосов
/ 14 января 2019

package.json

{
  "name": "env",
  "version": "1.0.0",
  "description": ".history",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js",
    "manual": "node manual.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "aws-sdk": "^2.209.0",
    "commander": "^2.15.0",
    "deepmerge": "^2.1.0"
  }
}

следующий код

 try {
      await cloudFormationService
        .createStack({
          StackName: fullStackName,
          TemplateBody: merged
        })
        .promise();
    } catch (e) {
      throw e;
    }

Результаты со следующей ошибкой

(node:7452) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): InsufficientCapabilitiesException: Requires capabilities : [CAPABILITY_IAM]
(node:7452) [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

Как только я добавлю возможности в соответствии с этим https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFormation.html

try {
  await cloudFormationService
    .createStack({
      StackName: fullStackName,
      TemplateBody: merged,
      Capabilities: [
        CAPABILITY_IAM
      ]
    })
    .promise();
} catch (e) {
  throw e;
}

Я получаю результаты со следующей ошибкой

(node:11840) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: CAPABILITY_IAM is not defined
(node:11840) [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.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...