
上QQ阅读APP看书,第一时间看更新
Basics of creation
After clicking on Create function, you will see the screen where the Lambda function can be created.
There are various options for creating a Lambda function, as follows:
- Author from scratch: Write the function from the ground up, with all of the configuration and code done by the developer.
- Blueprints: There are multiple templates that AWS has created to abstract away the boilerplate code and configuration when creating a Lambda function, allowing for a quick start.
- Serverless Application Repository: The Serverless Application Repository has the turnkey Lambda functions that can be deployed to production in one click. These are created by the community, AWS developers, and other companies.
For the purpose of this exercise, we will author a Lambda function from scratch. The following screenshot shows the details:
Note the following steps from the preceding screenshot:
- Choose to author a Lambda function Author from scratch.
- Choose the runtime as Java 8.
- Create a new execution IAM role: greeter-service-executor-role.
- Select Test Harness permissions as the policy to attach to the greeter-service-executor-role.
These are sensible defaults, provided by AWS. One has to be careful with the nomenclature. Clicking on Create function provides the basic skeletal structure for further configurations.