EC2 Plugin Jenkins with IAM Role

Use this for Jenkins and Slave it self

 

Important is am:PassRole

 

https://aws.amazon.com/blogs/security/granting-permission-to-launch-ec2-instances-with-iam-roles-passrole-permission/

https://engineering.aol.com/bits/574213645bf6233aab3f2c71/cross-account-aws-deploployments-in-jenkins

https://wiki.jenkins-ci.org/display/JENKINS/Amazon+EC2+Plugin

{
“Version”: “2012-10-17”,
“Statement”: [
{
“Action”: [
“ec2:DescribeRegions”
],
“Effect”: “Allow”,
“Resource”: “*”
},
{
“Action”: [
“ec2:CreateTags”,
“ec2:DescribeInstances”,
“ec2:DescribeKeyPairs”,
“ec2:GetConsoleOutput”,
“ec2:RunInstances”,
“ec2:StartInstances”,
“ec2:StopInstances”,
“ec2:DescribeTags”,
“ec2:DeleteTags”,
“ec2:DescribeRegions”,
“ec2:DescribeAvailabilityZones”,
“ec2:DescribeSecurityGroups”,
“ec2:DescribeSubnets”,
“ec2:DescribeImages”,
“iam:PassRole”,
“ec2:TerminateInstances”
],
“Effect”: “Allow”,
“Resource”: “*”,
“Condition”: {
“StringEquals”: {
“ec2:Region”: “eu-central-1”
}
}
}
]
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s