5

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?

Zanchey
  • 3,051
  • 22
  • 28
jaywayco
  • 151
  • 2

1 Answers1

0

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": "*"
        }
    ]
}
fission
  • 3,601
  • 2
  • 21
  • 31