Create a GO Lambda Resource (2023)
For this starter lambda, we create a Lambda Resource with the AWS Console.
Create a GO Lambda Resource in the AWS Console
- Navigate to Service Lambda
- Click “Create Function”
- Choose author from scratch
Choose this to code our own function
- Use gosimple as the function name. As we refer to this name when we deploy the code, this is the primary ID for the function.
- This is the runtime. As we are coding GO, we choose “Go 1.x”. With other languages, you would have to change this with each new minor version change. With GO, it is “1.x”, no matter if you use GO 1.13 or GO 1.17 or GO 1.x.
- Use X86 as architecture. We must build the GO code for this target architecture.
- After filling all parameters, click the button
Create Function
This creates the Lambda resource as well as a necessary IAM Role.
Change the handler
After the function is created, go to the Code tab and update the Runtime Settings
- Change the Handler name to
main
Now we can code a function.
See also
Source
See the full source on github.
Sources