Created
February 25, 2017 19:35
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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