- Newest
- Most votes
- Most comments
If I try to access api.example.com/example, it returns me:
You need to access api.example.com/example/exampleService
When you access api.example.com/example you are calling the GET on the root resource of your API, which is not currently configured with an integration, hence the 403 "Missing Authentication Token" result.
If you want api.example.com/example to work, you would need to add the appropriate method to the root resource of your API.
Regards,
Bob
Now that works.
But I don't understand. Why do I need to use /example/exampleService if I already have it explictly declared in the Custom Domain Name?
Also, I was thinking about routing my functions as microservices with something like this: api.example.com/users/, api.example.com/companies/, etc. Each microservice as a different AWS Lambda function. Is that possible?
Why do I need to use /example/exampleService if I already have it explictly declared in the Custom Domain Name?
The non-custom domain URL for your lambda function is: https://xxx.execute-api.us-east-1.amazonaws.com/default/exampleService
All your custom domain configuration is doing is mapping https://xxx.execute-api.us-east-1.amazonaws.com/default/ to https://api.example.com/example/
If you don't want to include the "example", you would need to have an empty basepath mapping. If you don't want to include the exampleService, you would need to update your API to have a method at the root resource of the API.
Also, I was thinking about routing my functions as microservices with something like this: api.example.com/users/, api.example.com/companies/, etc. Each microservice as a different AWS Lambda function. Is that possible?
Yes, this is very much possible. You can configure this with separate APIs (with the method at the root resource) with a basepath mapping for each, or a single API with the resources for each microservice (/users, /companies) and a single empty basepath mapping to this API.
Regards,
Bob
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago