Now we want to use our API endpoint we have been using before to have a single API endpoint to all of our API calls. For doing that we will connect our load balancer to fordward all requests to the path /*/search/*
Firstly we need to create a new Target Group
with our lambda registered as the targets.
- Go to EC2 under Computing section.
- Click on Target Groups.
- Click on Create Target Group.
- Put a name and choose
Lambda function
as Target Type. - Select your lambda and click Create
Now we will modify our load balancer to add a fordwarding rule for the new target group.
- Go to EC2 under Computing section.
- Click on Load Balancers on the left.
- Select your load balancer, go to the
Listeners
tab and click onView/edit rules
. - Add a new rule with condition
IF
path is/*/search/*
THEN
Forward to your Target Grup you created before. - Click on Update
This is the end of this part of the workshop. You could continue reading more about serverless architecture in the AWS ecosystem here.