Skip to content

Instantly share code, notes, and snippets.

@marcelog
Created February 25, 2017 19:35
Show Gist options
  • Save marcelog/0ffe391e8edd7049e32e0570e66cbc38 to your computer and use it in GitHub Desktop.
Save marcelog/0ffe391e8edd7049e32e0570e66cbc38 to your computer and use it in GitHub Desktop.
Policy needed for a Lambda function used to start and stop EC2 instances
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:*:*:log-group:/aws/lambda/*:*:*",
"Effect": "Allow"
},
{
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeInstanceStatus"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"ec2:StopInstances",
"ec2:StartInstances"
],
"Resource": "arn:aws:ec2:*:*:instance/*",
"Effect": "Allow"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment