What are the minimum permission needed to start an EC2 instance

0

What are the least privileged needed to start an EC2 instance: Can get to work with ec2:*

but when try to limit the policy with the following the creation fails:

        - Sid: EC2GuardRail
                Effect: Allow
                Action:
                   - 'ec2:RunInstance'
                   - 'iam:PassRole'
                   - 'ec2:DescribeSubnets'
                   - 'ec2:DescribeSecurityGroups'
                   - 'ec2:DescribeInstances'
                   - 'ec2:DescribeInstancesTypes'
                   - 'ec2:CreateTags'
                   - 'ec2:DescribeImages'
                   - 'ec2:DescribeKeyPairs'
                   - 'ec2:DescribeVpcs'
                   - 'ec2:CreateSecurityGroup'
                   - 'ec2:AuthorizeSecurityGroupIngress'
                   - 'ec2:CreateKeyPair'
                   - 'ec2:RunInstance'
                   - 'ec2:TerminateInstance'
                Resource:
                 - '*'
1개 답변
-1

Hello,

To start an EC2 instance, the only Action I see that you're missing is ec2:StartInstances.

In regards to minimum permissions for starting an instance, I would recommend allowing:

ec2:StartInstances
ec2:DescribeInstances

You may also want to grant ec2:StopInstances if you want to allow a user to also stop the instance.

You could also limit the scope to only the user who created the instance or instances that match a specific tag. See here for additional documentation on that: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_ec2_tag-owner.html

profile pictureAWS
전문가
Chris_G
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠