Serverless authorizer deleted when removing separate service - node.js

Good afternoon all, I have been running into a weird issue with the serverless cli tool over the last week. My team and I have an authorizer that we deploy separately from our APIs. When we deploy our APIs we attach said authorizer to the API gateway. All is good and well there. But our issue comes when we go to clean up a test API. When we run serverless remove on an API that uses the authorizer, the authorizer itself also seems to get removed, cloudformation stack and all. I am very confused as to why removing one of our APIs seems to remove a separately deployed authorizer. I was wondering if anyone could enlighten me as to a reason this may be happening, I don't believe I saw anything in the documentation if this is an intended feature or not.
We have been doing work on feature branches for our APIs and any time someone removes their test instance from our AWS account it also removed the authorizer. I have been under the impression that running serverless remove in a given project only removes the resources that the project itself spun up, not other things that it interfaces with as well.
Thanks in advance!

This was resolved, our naming we were using for both services was the same for some reason and so when one deployed it overwrote the other in cloudformation.

Related

Microservices on GCP

I am looking to use GCP for a micro-services application. After comparing AWS and GCP I have decided to go with Google because one major requirement for the project is to schedule tasks to run in the future (Cloud Tasks) which AWS does not seem to offer an equivalent of.
I am planning on containerizing my services and deploying to GCP using Cloud Run with a Redis cluster running as well for caching.
I understand that you cannot have multiple Firestore instances running in one project. Does this mean that all if my services will be using the same database?
I was looking to follow a model (possible on AWS) where each service had its own database instance that it reached out to.
Is this pattern possible on GCP?
Firestore indeed is for the moment limited to a single database instance per project. For performance that is usually not a problem, but for isolation such as your use-case, that can indeed be a reason to look elsewhere.
Firebase's original Realtime Database does allow multiple instances per project, and recently added a REST API for provisioning database instances. Since each Google Cloud Project can be toggled to also be a Firebase project, you could consider that.
Does this mean that all if my services will be using the same database?
I don't know all details of your case. Do you think that you can deploy a "microservice" per project? Not ideal, especially if they are to communicate using PubSub, but may be an option. In that case every "microservice" may get its own Firestore if that is a requirement.
I don't think one should consider GCP project as some kind of "hard boundaries". For me they are just another level of granularity - in addition to folders, etc.
There might be some benefits for "one microservice - one project" appraoch as well. For example, less dependent lifecycles, better (more accurate) security, may be simpler development workflows...

Do I need to have another layer of security between my front-end app and my Firebase database?

I'm self taught, and been coding just for myself for personal projects, so never had an impression from anyone else.
I've been using Firebase since I've started coding (about a year and a half ago) and I pretty much execute all the actions from my front-end. In React.js for example I just have my actions file and do all the set, update, file uploads etc from there.
I've recently started learning Node.js and MongoDB and was surprised at how similar the two are, but that kind of confused me. Should I have used another "layer" of security between my front-end and my Firebase data base?
My intuition says that the Firestore rules are what covers that part, so no, but I want to make sure.
You're right: when you use Firebase, the role of the traditional server is taken by:
Security rules
Your application code
Cloud Functions
I'd typically consider this a prioritized list: first try to catch logic in security rules, then perform them in application code (and use security rules to ensure they still follow your business rules), and finally implement them in Cloud Functions if you can't capture it in rules and client-side code.

What is a good way to compile nodejs

I am new to NodeJS development using NodeJS10.x version. I read questions and it turns out Javascript cannot be compiled, but I wanted to know if there is a way I can identify code issues before deploying it to production environment. I am developing a serverless application using serverless framework and deploying it on AWS. I use Aurora RDS with MySQL, so if there is a code issue the connection is not closed properly resulting in unwanted timeouts. And cloudwatch logs also doesn't show any error, so debugging is time consuming. Please advice with a standard way of handling such situations. Thanks.

Use AppSync and Amazon RDS with serverless-graphql

There is this great repository with example implementations of different serverless scenarios.
Right now I'm struggling with the combination of AppSync and Amazon RDS. I tried the implementation of the standalone rds, and the appsync examples provided in the repository. These are working like a charm.
But obviously there are many differences and difficulties if you'd like to combine these technologies. I used the schema, resolver and handler functions from the rds directory and combined it with the appsync lambda implementation. I adjusted the mapping templates and updated the serverless.yml file.
I could successfully deploy the whole appsync service and all resources without any errors. I'm able to access the graphql endpoint from graphiql and do my queries. But when I try it from the appsync console I get null as a response. I guess it has something to do with the mapping templates, but I'm not quite sure.
Has anybody got any suggestions or maybe a working example of this specific combination?
I finally could figure out a working implementation for this specific setup which I want to share with all of you.
Check out my serverless-graphql-appsync-rds repository on GitHub and leave me some feedback!
Note that this repository contains just the source code without any explanations. I'll create a better documentation in the near future.

Easiest server and database services available for deploying an application (AWS specifically)

I have written a real-time multiplayer game and currently writing its server in NodeJS. I want my game to have login, level up etc, so I need to have a database. This is the first time I am deploying something and I am mostly self taught, so please correct me if I am mixing things up. Since this is my first trial, I do not want to make much commitment right away so I am looking for free options only. And since this should be a real-time game, I need a relatively fast server response. That is why I am looking for the easiest database and server provider that would do and I am aware that with those restrictions I have limited choices and functionality.
As far as I have read online, Heroku seems to be my simplest option for a server (that is why I started writing in NodeJS). However it seems like there is no free database service since all options on https://devcenter.heroku.com/articles/heroku-postgres-plans has monthly fee. I did not want to use Google App Engine since I am new (it certainly is not mentioned as beginner friendly).
So I have found AWS following Free Cloud Database Service for home development post, it seems like I could use Amazon Web Services as a server and database. However most posts I have encountered suggests Google App Engine or Heroku with little mention of AWS. Is this because I am mixing concepts up, or does AWS have drawbacks that I am not aware of? Do you think it is a good idea to use AWS for both as server and database, is it possible to use Heroku as server while using AWS as database or do you have any other suggestion?
Note: Sorry for the question bombardment but those are all related and I am sort of lost in this topic so I had to ask...
Use AWS EC2 for the server and RDS for the database. The reason why people use heroku is that it deploys to a custom url very quickly (it's easy to set up). Setting up AWS requires some knowledge of how servers work, but it's not that complicated (and it's free for small apps). Best of luck!

Resources