Calling Get-EC2Instance
from EC2 instance and getting
Get-EC2Instance : You are not authorized to perform this operation.
Which IAM action do I need to add to my policy?
Calling Get-EC2Instance
from EC2 instance and getting
Get-EC2Instance : You are not authorized to perform this operation.
Which IAM action do I need to add to my policy?
I also faced the same Unauthorized issue with Get-EC2Instance
in PowerShell. To get this to work, attach the permissions below to your role policy. Looks like the DescribeNetworkInterfaces
permission is required in addition to DescribeInstances
.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeNetworkInterfaces"
],
"Resource": "*"
}
]
}