From the course: AWS: Automation and Optimization (2019)

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Create a Lambda function

Create a Lambda function

- [Instructor] To create a Lambda function, you'll need to log in to the AWS console and navigate to the Lambda service, which can be found under the Compute section. Next, we'll click on Create a function under the getting started section. Here, we are presented with three options. The first one is Author from scratch. This allows us to write our own Lambda function. The second one is Blueprints. This allows us to use one of the preconfigured templates to build our Lambda function. The third one is AWS Serverless Application Repository. Use this option to choose from applications published by AWS, AWS partners, and other developers. For now, we'll select the first option, Author from scratch. We'll create a Lambda function that automatically stops all running EC2 instances. We'll start by providing a name. Let's call it as stopEC2. Next, I'll select the runtime, which in this case is Python 2.7. Next, we need to provide an IAM role containing the permissions required by the Lambda…

Contents