我正在尝试首次将Django应用程序部署到Elastic Beanstalk上。我一直在关注两个教程here和here以寻求帮助,但我遇到了教程似乎没有涉及的问题。
我到目前为止所遵循的步骤是将awsebcli安装到Python3.4虚拟环境中并cd到我的项目目录。然后我打电话给eb init
。然后提示我输入我的访问密钥。我已将它们保存到文本文件中,因此我只需复制并粘贴我的密钥(确保没有尾随的空格)到终端中。
问题是错误被抛回:
错误:操作被拒绝。我们计算的请求签名与您提供的签名不匹配。检查您的AWS Secret Access Key和签名方法。有关详细信息,请参阅服务文档。
奇怪的是,在我输入部署的区域编号后,在后续尝试中会弹出错误。但无论如何它仍然会提示我钥匙:
错误:当前用户没有正确的权限。原因:操作被拒绝。我们计算的请求签名与您提供的签名不匹配。检查您的AWS Secret Access Key和签名方法。有关详细信息,请参阅服务文档。
以下是eb init --debug
的完整输出:
e$ eb init -- debug
Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-south-1 : Asia Pacific (Mumbai)
7) ap-southeast-1 : Asia Pacific (Singapore)
8) ap-southeast-2 : Asia Pacific (Sydney)
9) ap-northeast-1 : Asia Pacific (Tokyo)
10) ap-northeast-2 : Asia Pacific (Seoul)
11) sa-east-1 : South America (Sao Paulo)
12) cn-north-1 : China (Beijing)
(default is 3): 3
ERROR: The current user does not have the correct permissions. Reason: Operation Denied. The security token included in the request is invalid.
You have not yet set up your credentials or your credentials are incorrect
You must provide your credentials.
(aws-access-id): xxxxxxxxxxxxxxxxxxxxx
(aws-secret-key): xxxxxxxxxxxxxxxxxxxxxxxxxxx
ERROR: Operation Denied. The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST
/
host:elasticbeanstalk.us-west-2.amazonaws.com
x-amz-content-sha256:2dc533b6c6fe3c628385d2b22bfa9e25e75730ee05f85d3b1ce7bacddc535e27
x-amz-date:20160719T134302Z
host;x-amz-content-sha256;x-amz-date
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
The String-to-Sign should have been
'AWS4-HMAC-SHA256
20160719T134302Z
20160719/us-west-2/elasticbeanstalk/aws4_request
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
答案 0 :(得分:6)
事实证明问题是我的安全密钥已经过时了#34;这是因为我在第一组密钥的生成和部署应用程序的尝试之间更改了IAM权限。
生成一组新密钥解决了这个问题。
答案 1 :(得分:0)
就我而言,我必须指定区域和配置文件。这可能是因为我要与中国和世界其他地方打交道。
<块引用>eb init --profile chinaprofile --region cn-northwest-1