Vealty... new project
Because I want my web UI can also be able to easily turn into native app, I did a lot of research of different UI Framework. At the end, it came down to 2 candidates: Vuetify and Quasar . And I finally chose Quasar. The reason is that it seems to have more support on different platforms. I didn't use Quasar CLI just because I have used Vue CLI, I just didn't know how to integrate them together. so, i use Quasar as a plug-in, for now. I will talk more about the experience with it later. so far, pretty happy with it.
I had experience with Elastic Bean Stalk and MongoDB. so, this time, I want to do something different. I want to use Lambda and DocumentDB (AWS Mongo). I did a lot of readings and got some advices from my good friend. So, instead of writing a lot of lambda functions for each REST resource. I just use Express.js but deploy as a Lambda. To do that, I use serverless.com Express example to start with. (also see github.com/serverless-components/express ) In which I had a very good start. It is just amazing how it simplifies the deployment and creating AWS resources. (e.g. create the API gateway and Subdomain for me).
Then, I hit my first road block. First, I created the DocumentDB using the AWS Cloud9 & DocumentDB example, which has no problem. Then, I tried to connect to DocumentDB from my lambda using Mongoose ( and also Mongo Client). It failed. I know there is something about the connection because of the connection timeout. So I checked the VPC of the lambda. It has no VPC attached. So, I did more research and I also add the IAM Role for the lambda which include these policies:
and i added that to the serverless.yml.
still didn't work.
I even tried to manually add the VPC to the lambda but didn't work. I was stuck. I even messaged to AWS Support, stackoverflow etc. but didn't get any answer.
Until I asked my friend who worked in AWS and had better experience than me to help. After some searching, he found out that the API gateway point to the "default" version of the lambda, not the latest. So if I added VPC manually to lambda, API gateway still point to the older version. So i just need to manually remove the "default". And Wola ! it works.
so, next thing is, I have to learn serverless and how to do the yml. especially the VPC component YML. so that when I deploy, I can add the VPC to the Lambda. :)
I will share some codes later.