What permissions in IAM do i need to start EC2 instances with chef knife?
Q1: I had to debug knife-ec2 gem in order to find out the minimal IAM permissions required to start an EC2 instance. Here is the minimal policy:
{
"Statement": [
{
"Sid": "Stmt123",
"Action": [
"ec2:RunInstances",
"ec2:DescribeInstances",
"ec2:DescribeKeyPairs",
"ec2:DescribeImages",
"ec2:CreateTags",
"ec2:DescribeTags"
],
"Effect": "Allow",
"Resource": [
"*"
]
}
]
}
Please note the Sid should be unique.
Q2: My knowledge of Ruby is quite limited so possibly there is not convenient way for debugging. Personally I used binding.pry as a debugger. Please refer to the following article for more info.
You will need to allow RunInstances.