简体   繁体   English

尝试初始化AWS Amplify时出现OptInRequired错误

[英]OptInRequired Error when trying to init AWS Amplify

I just started using AWS Amplify. 我刚刚开始使用AWS Amplify。 I've installed and configured the CLI and I'm trying to initialize a project. 我已经安装并配置了CLI,并且正在尝试初始化项目。 However, after making the selections I get the following error: 但是,进行选择后,出现以下错误:

Edwards-MacBook-Air:amplify-js-app edward$ amplify init
Note: It is recommended to run this command from the root of your app directory
? Enter a name for the project amplify-js-app
? Enter a name for the environment env
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building javascript
Please tell us about your project
? What javascript framework are you using none
? Source Directory Path:  src
? Distribution Directory Path: dist
? Build Command:  npm run-script build
? Start Command: npm run-script start
Using default provider  awscloudformation

For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html

? Do you want to use an AWS profile? Yes
? Please choose the profile you want to use default
⠧ Initializing project in the cloud...An error occurred when creating the CloudFormation stack
✖ Root stack creation failed
init failed
{ OptInRequired: The AWS Access Key Id needs a subscription for the service
    at Request.extractError (/Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/protocol/query.js:50:29)
    at Request.callListeners (/Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/Users/edward/.config/yarn/global/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
  message: 'The AWS Access Key Id needs a subscription for the service',
  code: 'OptInRequired',
  time: 2019-03-03T21:14:34.638Z,
  requestId: '581c6e4a-3df9-11e9-8269-59b4c2d8d7d2',
  statusCode: 403,
  retryable: false,
  retryDelay: 21.790819558046604 }

Can someone please help me with this issue? 有人可以帮我解决这个问题吗?

This is usually related to a new account, an updated payment method, or something like an unverified phone number. 这通常与新帐户,更新的付款方式或未经验证的电话号码有关。 Login to the console and make sure you don't have any notifications or alerts. 登录到控制台,并确保您没有任何通知或警报。 If you don't see anything I suggest calling AWS billing. 如果您看不到任何东西,建议您致电AWS账单。

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

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