Doubts about which infra to choose

Asked

Viewed 79 times

1

How would you put an API in the air along with a front-end?

Example:

I have an application in Angular JS A SPA and it has an API that requires a database, so how would I do it? Create an EC2 instance and a routing?

  • Welcome to Stack Overflow! Welcome to Stackoverflow in English. I edited your question to remove the greetings, as we usually keep them as clean as possible to focus on your scheduling question. If you are interested in visiting a part of the site that is not aimed to ask questions can know the Stack Overflow Chat in Portuguese. If you have questions about the operation, rules and procedures of the site visit the Stack Overflow in English Meta :)

2 answers

2

If you’re really going to use the AWS, I suggest the following:

An instance that is part of the Free Tier, so you have one year of testing (if you haven’t already used it) and put your application. Remember to update the security group of the instance to allow access only to the necessary ports and also not allow access to port 22 of any source, put your current IP.

Still on the instance, it will already have a public IP associated but this IP will change if the machine is turned off, if it is restarted the IP remains the same. If you want to have a fixed public IP, you need to use the Elastic IP.

For the database you can use the RDS but it is very expensive and you can solve this situation by placing your bank in another instance or even in the same instance of your application, which I do not recommend. The advantage of using RDS and the reason for its high cost is that Amazon is responsible for generating backups and keeping your bank up to date, with minimal involvement on your part as well as giving you the option of Multi A-Z where you will have your bank available in different areas, giving you more security.

You can create a domain and set it to point to your machine’s public IP.

If you have more than one instance running your application, you can create one Elastic Load Balancer (ELB), it will have a DNS and you can use it but can not use the Ips because they change.

  • Friend, thank you very much, but is it about the DNS? Usually it gets S3.aws.... would I be able to put my own DNS there? How would I give?

  • Sorry for the delay in responding but you can set this up by your own domain administrator, you will make a redirect, every time you hit your domain it will be sent to S3.aws

1

Could you be more specific? The database you need to host too, or just access external?

If the site is "static", that is, only with Javascript and the like, you do not need an EC2 instance to host, you can leave it on S3 and make it public.

If it is "dynamic", and you need some server processing the client response, then yes use an EC2 instance and install whatever you need to run on it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.