Deploy and manage WebApp with AWS services - amazon-web-services

I’m noob with AWS services, I develop web application with Ruby on Rails, so, I’ll like to know what could be the best way or the right one to deploy and manage web application with AWS.
Right now there are bunch of services of AWS for handle web apps, but I’m not sure which service to use, OpsWork, EC2 (setup the entire server), Elastic Beanstalk or EC2 Containers and so on…
Well, I have 3 small apps from diferentes clients and I’m looking the right way to have them on one instance or couples of instances, right know i’m with OpsWorks, I have 3 stack, one for each web app, I want to know if I can deploy and manage those apps in one stack and 2 instance of OpsWorks or there are better way or other services as IaaS or PaaS solutions?. So i’m looking for advise or orientation for use AWS service for those kind of thing.

This question is rather vague and the answer depends on the needs of your app, but I'll give my 2 cents regardless. I have several rails apps hosted on EC2 instances running Ubuntu, NGINX, and Phusion Passenger. The apps that receive a decent amount of traffic and require consistent performance/availability are cloned across multiple EC2 instances (in multiple zones) and have traffic managed by Elastic Load Balancers (ELBs). The app databases are served through amazon's RDS services. Domain registration and nameservers are set up through AWS Route 53. Static assets are served from AWS S3.
This type of architecture certainly has a price tag on it and isn't the only way to do it. My experience has been that all of my older Rails apps have survived over a year with 100% uptime and rarely have moments of slowness been the fault of AWS as opposed to my own code or 3rd-party software.
Hope this helps; feel free to ask questions.

Related

How to deploy many applications with subdomains in AWS? Which config should I use?

I'm new to AWS and deployment. Here's my doubt.
I've a domain, let's say www.company.com. I've 3 apps to deploy,
NodeJS Backend (api.clientName.company.com)
React Marketplace (clientName.company.com)
React Admin Panel (admin.clientName.company.com)
So I'll customize as per clients requirements and deploy like clientName.company.com.
What config should I use for many clients? Now I got 5 more new clients. Can I create only one EC2 instance and manage all clients apps together? Also can I migrate my domains to route53 so that I can create unlimited subdomains?
Can anyone explain my doubts.
Yes, you can manage multiple applications on single EC2 instance, but make sure the instance size is large enough to withstand the traffic.
You can achieve this by using Laravel Forge in which you can deploy Laravel and simple PHP Applications as well. It just makes things easier to manage.
If you not comfortable using Laravel Forge you can use Filezilla too.
It is better if you migrate domains into Route53 as it will be easier to manage and everything will be in one place.
You can create the subdomains as you like and map it to the EC2 instances Elastic IP, make sure you attach an EIP so that the IP address does not change after a reboot.

Need Assistance Hosting on AWS

So I’ve just finished working on my first big personal project, bought a domain name, created an AWS account, watched a lot of AWS tutorials, but I still can’t figure out how to host my web app on AWS. The whole AWS thing is a mystery to me. No tutorial online seems to teach exactly what I need.
What I’m trying to do is this:
Host my dynamic web app on a secure https connection.
Host the web app using the personalized domain name I purchased.
Link my git repo to AWS so I can easily commit and push changes when needed.
Please assist me by pointing me to a resource that can help me achieve the above 3 tasks.
For now, the web app is still hosted on Heroku’s free service; feel free to take a look at the application, and provide some feedback if you can.
Link to web app:my web app
You mentioned - The web app is still hosted on Heroku’s free service
So, if you want the same thing in AWS, use Elastic Beanstalk.
First Question: How to host my web app on AWS?
There can be multiple options to host your web app:-
S3 Bucket to host your website. How to Host in S3
Elastic Beanstalk. Link
ECS - using containers
Single EC2 Server to host your website.
EKS - Kubernetes
By the way, there are many couples of things which you need to take care of before starting.
Second Question, Host the web app using the personalized domain name I purchased.
If you have used S3, the hosted URL will be in HTTP and you can create a route entry in your purchased domain settings. If it is AWS, create a new record in Route53.
If you host your website on EC2, you will get Public IP Address. Make a route entry with that Public IP.
If you have used ECS or EKS, you might require to use the Load Balancer and then you will have the Load Balancer DNS. Make a route entry with your Load Balancer DNS. Then again question will arise which kind of Load Balancer you want to use. [Like Application, Classic or Network Load Balancer]
If you use Elastic Beanstalk. It's a managed service, when you host you will directly get an endpoint. Make a route entry with that endpoint.
Third, Link my git repo to AWS so I can easily commit and push changes when needed.
For this, you have to use Code Build and connect Github as a Source while creating Code Build Project. Link
For CI-CD, there are multiple things again.
As Heroku’s is a PaaS, which provides you the platform and but when it comes to AWS, it is an IaaS. So you get the infrastructure and when you get the provisioned infrastructure, there are so many things which you need to take care of like you have to think like an Architect. Prepare the architecture and then proceed. It requires knowledge of other things also networking, security etc.
To answer your question, the best way to host a web app in AWS is Elastic Beanstalk
But what is AWS Elastic Beanstalk and what does it do?
AWS Elastic Beanstalk encompasses processes and operations connected with the deployment of web apps into the cloud environment, as well as their scaling.
Elastic Beanstalk automates the deployment by putting forward the required capacity, balancing the load, autoscaling, and monitoring software efficiency and performance. All that is left for a developer to do is to apply the code. In these conditions, the application owner has overall control over the capacity that AWS provides for the software and can access it at any time.
So this is the best way to deploy the app and let’s follow the steps.
Open the Elastic Beanstalk console and find the management page of your environment.
Select “Upload and Deploy”.
Select “Choose File” and choose the source bundle with the dialog box.
Deploy and select the URL to open the new website.
You can use CodeDeploy to connect your Github and deploy your code
Conclusion
I have taken a simplistic approach and told you exactly what you need to do the required task without going into the hus and fuss of AWS. Saying that there is still a lot that can be done to bring the real value of your application in terms of balancing the load, scaling or improving the performance.

Setting up an Amazon Server with Go Daddy

I am trying to set up an Amazon Server to host a dynamic website I'm currently creating. I have the domain bought on GoDaddy.com, and I believe that what I've done so far has linked the domain to my Amazon account.
I followed this tutorial : http://www.mycowsworld.com/blog/2013/07/29/setting-up-a-godaddy-domain-name-with-amazon-web-services/
In short, this walked me through setting up and Amazon S3 (Simple Storage Service) and Amazon Route 53. I then configured the DNS Servers, and my website now launches properly on the domain.
I'm not sure on the next step from here, but I would like to set up:
-A database server
-Anything else that might be necessary to run a dynamic website.
I am very new to hosting websites, and semi-new to web development in general, so the more in depth the better.
Thanks a lot
You have two options on AWS. Run an EC2 server and setup your application or continue to use the AWS managed services like S3.
Flask apps can be hosted on Elastic Beanstalk and
your database can be hosted on RDS (Relational Database Service). Then the two can be integrated.
Otherwise, spin up your own t2.micro instance in EC2. Log in via ssh and set up the database server and application like you have locally. This server could also host the (currently S3 hosted) static files too.
I have no idea what your requirements are, personally I would start with setting up the EC2 instance and go from there as integrating AWS services is without knowing what you need is probably not the easiest first step.
Heroku might be another option. They host their services on AWS and give you an end to end solution for deploying and running your python code without getting your hands dirty setting up servers.

Amazon ElastiCache vs Ramfs in Linux

I am new to Amazon Web Services. I was reading about Amazon ElastiCache and wanted to clarify if it is like (may be more than that) using RAM filesystem in Linux where we use a portion of system memory as a file system. As I referred AWS documentation it says ElastiCache is a web service. Is it like an EC2 instance with few memory modules attached? I really want to understand how it exactly works.
Our company has decided to migrate our physical servers into AWS cloud. We use Apache web server and MySQL Database running in Linux. We provide a SaaS platform for e-mail marketing and event scheduling for our customers. There is usually a high web traffic to our website during 9am-5pm on weekdays. I would like to understand if we want to use ElastiCache service, how it will be configured in AWS.? We have planned two EC2 instances for our web server and an RDS instance for the database.
Thanks.
Elastic cache is simply managed Redis or Memcached. Depending which one you choose, you would use the client for the cache with your application.
How you would implement it depends on what kind of caching you are trying to accomplish.

AWS Elastic Beanstalk necessary for Websites (vs. web apps)?

The documentation only refers to web applications. Do I use the Elastic Beanstalk for my website or is it strictly for web apps? I've launched an EC2 instance that is not connected to the Elastic Beanstalk, however the default instance is running in the Elastic Beanstalk environment.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html
Elastic Beanstalk can be used for several type of applications:
Web App. Websites are included in "Web App" but it could be just a simple REST Api used by a mobile app and it would work as well.
Worker Application. Typically an application that would get message from a queue like SQS.
Elastic Beanstalk is a tool to help deployment of an entire infrastructure, from installing a webserver to deploy the code of the application and applying custom installation script. If you have a website using any technology supported by Elastic Beanstalk (Java, Node.js, PHP, Python, Ruby, and .NET) , I would definitely suggest that you use it as it is very simple to use and gives you a lot of advantages over a single ec2 instance.
You can read documentation for workers application here : http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html
And I would suggest that you read the FAQ for more details:
http://aws.amazon.com/elasticbeanstalk/faqs/
As an example, in my company we set up beanstalk for more than 15 websites: internal Backend tool in PHP, workers to send sms or emails, website with thousands of simultaneous users. One of the important point to mention is to be able to have a new website infrastructure up in about 20 minutes (new server with all configuration and code deployed).
Hope this helped you to understand Elastic Beanstalk. Don't hesitate to ask some more question and check Stackoverflow, there is a lot of information about it.