Wednesday, January 13, 2016

AWS Start EC2 Instance from Command Line

First, setup permissions. The simpler way to do it is to use IAM, create a group, give it permissions to start instances and then add a user to the group.

The permission can be added for each instance using the Policy Generator:

  1. Effect: Allow
  2. AWS Service: Amazon EC2
  3. Actions: StartInstances
  4. ARN: e.g. arn:aws:ec2:ap-southeast-1:<accountId>:instance/<instanceId>
To include multiple instances, either add multiple statements or edit the policy statement manually later to add more instances.

You can start the instance via AWS API using the "ec2-start-instances" command.

References:

No comments:

Post a Comment