TECHIES WORLD

For Techs.... Techniques.... Technologies....

AWS

How to restrict the user access on single EC2 instance with start and stop permissions only

Sometimes we need to give access to users on an a single EC2 instances with start and stop permissions without the terminate option.

We can use the following IAM policy to acheive this requirement.

{
       "Version":"2012-10-17",
       "Statement":[
              {
             "Effect":"Allow",
             "Action":"ec2:Describe*",
             "Resource":"*"
              },
              {
             "Effect":"Allow",
             "Action":[
                    "ec2:StartInstances",
                    "ec2:StopInstances",
                    "ec2:RebootInstances"
             ],
             "Resource":[
                    "EC2-ARN"
             ]
             }
       ]
}

Here EC2-ARN need to be replaced with the ARN of the required EC2 instance.

That's all…