ojob ojob.io/aws/addEC2StartStopLambdas secKey= region=eu-west-1 role= name=StartStopEC2Instances
Tries to add a lambda to start or stop a list of provided ec2 instances. Do reuse or create a role with AWSLambdaBasicExecutionRole and the following policy:
{
"Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow", "Action": [ "ec2:DescribeInstances", "ec2:Start", "ec2:Stop" ], "Resource": "" },
{ "Effect": "Allow", "Action": [ "logs:CreateLogStream", "logs:CreateLogGroup", "logs:PutLogEvents" ], "Resource": "arn:aws:logs:::" }
]
}
Name | Description |
---|---|
secKey | The sBucket security bucket key with the AWS credentials (if not provided it will try the default access) |
region | The AWS region where the lambda will be added |
role | The AWS ARN role to use to execute this lambda (you need to provide an ARN role that has AWS Lambda and EC2 List/Start/Stop permissions) |
name | The lambda function name (defaults to 'StartStopEC2Instances') |