linux_wiki:lambda_python_function

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
linux_wiki:lambda_python_function [2019/08/09 22:13]
billdozor [Lambda: Pre-Reqs]
linux_wiki:lambda_python_function [2019/08/09 22:20]
billdozor [File Conversion Example: Pre-Reqs]
Line 55: Line 55:
  
 ---- ----
 +
 +===== Stop/Start EC2 Example: Pre-Reqs =====
 +
 +Create an IAM role
 +  * Services > Security > IAM > Roles > Create Role
 +    * Choose a service that will use the role: Lambda
 +    * Click 'Next:Permissions'
 +    * **Required**: Attach the AWS managed policy "AWSLambdaBasicExecutionRole" to your new role in order to log your Lambda function to cloudwatch logs.
 +    * Also, Create a new policy to allow basic EC2 list,stop,start. Example:<code json>{
 +    "Version": "2012-10-17",
 +    "Statement": [
 +        {
 +            "Sid": "VisualEditor0",
 +            "Effect": "Allow",
 +            "Action": [
 +                "ec2:DescribeInstances",
 +                "ec2:StartInstances",
 +                "ec2:StopInstances"
 +            ],
 +            "Resource": "*"
 +        }
 +    ]
 +}</code>
 +
 +----
 +
  
 ====== Lambda: Create Function ====== ====== Lambda: Create Function ======
  • linux_wiki/lambda_python_function.txt
  • Last modified: 2019/08/09 22:29
  • by billdozor