"Operation Denied" error while deploying Elastic Beanstalk using awsebcli

I am trying to deploy a Django application on Elastic Beanstalk for the first time. I am following two tutorials here and here for help, but I am facing a problem that the tutorials do not seem to cover.

The steps that I have performed so far have been that I installed awsebcli in the Python3.4 virtual environment and cd in the directory of my projects. Then I call eb init. Then I am prompted to enter the access keys. I saved them in a text file, so I just copied and pasted my keys (without saving spaces in spaces) into the terminal.

The problem is that the error is returned:

ERROR: operation canceled. The signature we signed for the request does not match the signature you provided. Verify the AWS passkey and signature method. See service documentation for more details.

It is strange that on subsequent attempts, the error appears earlier when I enter the region number for my deployment. But he still tells me the keys anyway:

ERROR. The current user does not have the correct permissions. Reason: operation canceled. The signature we signed for the request does not match the signature you provided. Verify the AWS passkey and signature method. See service documentation for more details.

Here is the complete conclusion 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'
+4
1

, , "". , IAM .

.

+4

Source: https://habr.com/ru/post/1648383/


All Articles