Deploying AWS Lambda
Explore the process of deploying AWS Lambda functions using the Serverless Framework. Learn to configure authentication with environment variables, deploy functions, test them via API endpoints, and manage them using the AWS Lambda console. Understand key deployment steps and how to safely handle access credentials.
We'll cover the following...
Deploying functions
Before proceeding, we need to add a few entries to the serverless.yml file. We’ll inject events that will enable us to send GET requests to the path: hello. To do that, we’ll insert a few lines right below handler.hello.
As we know from the previous sections, we’ll use sed magic to replace those values.
Next, we’ll need to let serverless CLI know how to authenticate itself before deploying the function.
There are a couple of ways to pass authentication to the CLI, and we’ll use the easiest method. We’ll define a few environment variables. Specifically, we’ll create AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
Note: If you’re already using AWS, you probably know how to get the keys. You may have already created them in one of the previous sections. If you didn’t, and you don’t know how to do that, please visit the “AWS Elastic Kubernetes Service (EKS) Clusters With Terraform” chapter for instructions. Come back here once you have the keys.
Replace the first occurrence of [...] with the access ...