放大:无法获取配置文件:缺少配置文件配置:未定义

问题描述

我在使用 amplify cli 时遇到了一些问题: 不知道是不是跟最近的cli更新有关...

amplify init
? Do you want to use an existing environment? Yes
? Choose the environment you would like to use: staging
Using default provider  awscloudformation
? Select the authentication method you want to use: AWS profile
Failed to get profile: Profile configuration is missing for: undefined

amplify configure
Specify the AWS Region xxx
Specify the username of the new IAM user: xxx
Complete the user creation using the AWS console

Enter the access key of the newly created user:
 accessKeyId:  ********************
 secretAccessKey:  ****************************************

This would update/create the AWS Profile in your local machine
? Profile Name: default
Successfully set up the new user.

amplify push
? Select the authentication method you want to use: AWS profile
Failed to get profile: Profile configuration is missing for: undefined

amplify push
? Select the authentication method you want to use: Amplify Admin UI

好的!这次正在工作

UPDATE_IN_PROGRESS ...
UPDATE_Failed      DeploymentBucket                         
AWS::S3::Bucket            Thu  API: s3:SetBucketEncryption Access Denied
(as admin)

我该如何解决这个问题?

解决方法

好的,我找到了解决方案。 在 amplify/.config/local-aws-info.json 里面 改变

  "staging": {
    "configLevel": "amplifyAdmin"
  }

{
  "staging": {
    "configLevel": "project","useProfile": true,"profileName": "default"
  }
}