在访问awscli ec2实例时,我们面临以下问题,其他计算机也是如此,我更新了awscli插件,仍然存在同样的问题,请帮助解决。
# aws ec2 describe-instances
An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials
# aws ec2 describe-instances --debug
2018-11-01 04:54:26,365 - MainThread - botocore.endpoint - DEBUG - Sending
http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://ec2.us-east-2.amazonaws.com/, headers={'Content-Length': '43', 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'Authorization': 'AWS4-HMAC-SHA256 Credential=AKIAIY3AGMW5XLHTYX4Q/20181101/us-east-2/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=fd4ac6b20d889b48c6895f9fb138696a9bda98e215a9be99f2a994a6936163fa', 'X-Amz-Date': '20181101T115426Z', 'User-Agent': 'aws-cli/1.16.45 Python/2.7.10 Linux/2.6.32-504.23.4.el6.x86_64 botocore/1.12.35'}>
2018-11-01 04:54:26,749 - MainThread - botocore.parsers - DEBUG - Response headers: {'Transfer-Encoding': 'chunked', 'Date': 'Thu, 01 Nov 2018 12:48:00 GMT', 'Server': 'AmazonEC2'}
2018-11-01 04:54:26,749 - MainThread - botocore.parsers - DEBUG - Response body:
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to validate the provided access credentials</Message></Error></Errors><RequestID>1c170c54-2b3b-48a0-bc06-3deab5fe5d20</RequestID></Response>
2018-11-01 04:54:26,750 - MainThread - botocore.hooks - DEBUG - Event needs-retry.ec2.DescribeInstances: calling handler <botocore.retryhandler.RetryHandler object at 0x7fe850982450>
2018-11-01 04:54:26,750 - MainThread - botocore.retryhandler - DEBUG - No retry needed.
2018-11-01 04:54:26,764 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 207, in main
return command_table[parsed_args.command](remaining, parsed_args)
File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 346, in __call__
return command_table[parsed_args.operation](remaining, parsed_globals)
File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 518, in __call__
call_parameters, parsed_globals)
File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 639, in invoke
self._display_response(operation_name, response, parsed_globals)
File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 659, in _display_response
formatter(command_name, response)
File "/usr/local/lib/python2.7/site-packages/awscli/formatter.py", line 69, in __call__
response_data = response.build_full_result()
File "/usr/local/lib/python2.7/site-packages/botocore/paginate.py", line 449, in build_full_result
for response in self:
File "/usr/local/lib/python2.7/site-packages/botocore/paginate.py", line 255, in __iter__
response = self._make_request(current_kwargs)
File "/usr/local/lib/python2.7/site-packages/botocore/paginate.py", line 332, in _make_request
return self._method(**current_kwargs)
File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 320, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 623, in _make_api_call
raise error_class(parsed_response, operation_name)
ClientError: An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials
2018-11-01 04:54:26,820 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255
An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials