Skip to content

AWS CLI permissions error? when running "aws ec2 describe-instances --output text > ec2s.txt"

0

Hi re:Post,

I have received what I think is a permissions error/issue when running this command (Thanks Gary!) from AWS CLI:

aws ec2 describe-instances --output text > ec2s.txt

Full text below:

[cloudshell-user@ip-10-132-44-57 ~]$ aws ec2 describe-instances --output text > ec2s.txt

Error when retrieving credentials from container-role: Error retrieving metadata: Received non 200 response 500 from container metadata: <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>500 - Internal Server Error</title>
 </head>
 <body>
  <h1>500 - Internal Server Error</h1>
 </body>
</html>
[cloudshell-user@ip-10-132-44-57 ~]$

Screenshot below: Enter image description here

Thank you for your time and help.

Best Regards,

Donald

asked 2 years ago496 views

2 Answers
1
Accepted Answer

Hi Donald,

Thanks for posting your questions here. I myself have experienced this error.

This has been previously asked too, did you get a chance to look at this re:Post discussion

Let me know if this doesn't help.

Happy to assist further.

Abhishek

AWS
EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Hi Abhishek - thank you for your quick reply and help! My session has not expired so it must be a permissions issue. I'm sure I don't have AWS Admin access or access to CLI. Do you happen to know what should permissions I need to execute on CLI? I will ping our AWS Admin but any info I can give him to enable this would be greatly appreciated! Thanks!

  • That looks like an internal issue with the cloudshell instance.

  • Sorry for my delayed response and by now you'd have figured out that this doesn't seem to be a permission issue but rather a temporary issue with that cloudshell session. If you see this frequently and have access to create support case, please report this to AWS support.

1

For other people who might have the same issue. I got that error this morning and it seems to be a permission issue with cloudshell itself, when either cloudshell:PutCredentials or cloudshell:ApproveCommand is missing. Adding cloudshell:* solves it.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.