How to host based routing different version in same AWS EB application - amazon-web-services

The question come from here that recently I am required to start a new project using AWS, while I was GCP developer before.
In GCP, I can deploy my application to AppEngine(similar to EB) with versioning like gcloud app deploy settings.yaml --version dev. Such that I can have host based routing on two links --
my-project.xxxx.com
dev.my-project.xxxx.com
Such that I can let others to have a domain for testing without starting an new instance, sharing all environment settings, dbs and storage.
However, when I come to AWS, it seems the story is completely different.
I try to follow this guide https://aws.amazon.com/blogs/aws/new-host-based-routing-support-for-aws-application-load-balancers/, but it is just for routing to different instances.
By the way I know that EB application can have multiple versions, so is it possible to do something like
my-project.xxxx.com -> go to default version
dev.my-project.xxxx.com -> go to version with tag 'dev'
So 2 questions,
Can I achieve what I want?
If can't, is starting another EB instance for testing only choice?

Related

How to move/clone an Elastic Beanstalk Environment between (Elastic Beanstalk) Applications

I'm new to AWS. For simplicity I have been working with a number of separate Elastic Beanstalk Environments, within the same Elastic Beanstalk Application
I have come to understand that Applications are just folders for Environments.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.html
I'm just trying to get more organized. Is it even possible?
First of all, applications are not literally folders for environments, according to the documentation an application is "a logical collection of Elastic Beanstalk components".
The idea behind it is to have a single codebase that get deployed to several environments with different configuration depending on your needs. You can have several application versions (or the same version if you want it that way) deployed in several scenarios (environments) with varying configurations, let's say different environment variables, or different values for them, different infrastructure, etc. So, from my point of view there's not much logic in cloning an environment to a different application, since usually different applications would require different configurations.
But, if for your particular needs, you have very similar applications (they use the same platform, consume some of the same resources and basically you wanna deploy them in a very similar way infrastructure-wise) I think a good idea could be writing configuration files for your desired environment and just add those to your different application's code (you can find the official documentation on .ebextensions here, they even give you this link with several common configuration files). Another approach could be directly using CloudFormation templates as discussed here and just recreate the entire application from a CF template.
I hope this helped
Just for someone like me who came here for solutions...
Actually you can clone a environment from one Application to another Application with some steps.
Just follow this AWS - How do I migrate my Elastic Beanstalk environment from one AWS account to another AWS account?
This doc tells you how to do it between 2 AWS accounts but you can do it in just one account. The idea is just:
Save Config in one Application
Load Config in another Application

Spring boot/cloud microservices on AWS

I have created a Spring cloud microservices based application with netflix APIs (Eureka, config, zuul etc). can some one explain me how to deploy that on AWS? I am very new to AWS. I have to deploy development instance of my application.
Do I need to integrate docker before that or I can go ahead without docker as well.
As long as your application is self-contained and you have externalised your configurations, you should not have any issue.
Go through this link which discusses what it takes to deploy an App to Cloud Beyond 15 factor
Use AWS BeanStalk to deploy and Manage your application. Dockerizing your app is not a predicament inorder to deploy your app to AWS.
If you use an EC2 instance then it's configuration is no different to what you do on your local machine/server. It's just a virtual machine. No need to dockerize or anything like that. And if you're new to AWS, I'd rather suggest to to just that. Once you get your head around, you can explore other options.
For example, AWS Beanstalk seems like a popular option. It provides a very secure and reliable configuration out of the box with no effort on your part. And yes, it does use docker under the hood, but you won't need to deal with it directly unless you choose to. Well, at least in most common cases. It supports few different ways of deployment which amazon calls "Application Environments". See here for details. Just choose the one you like and follow instructions. I'd like to warn you though that whilst Beanstalk is usually easier then EC2 to setup and use when dealing with a typical web application, your mileage might vary depending on your application's actual needs.
Amazon Elastic container Service / Elastic Kubernetes Service is also a good option to look into.
These services depend on the Docker Images of your application. Auto Scaling, Availability cross region replication will be taken care by the Cloud provider.
Hope this helps.

Setup a scalable architecture with social engine 4.7

I am having a SocialEngine 4.7 website and want to deploy it on a clustered environment on AWS. The trouble I am facing is that social engine keeps related files locally. I am not able to find a configuration to set these things.
Ex - It keeps all the images in public/ directory. I am not sure how that is mapped.
Can someone help on how to configure a scalable social engine environment? Some pointers around this are encouraged.
Looks like S3 is not a viable option here. Which AWS region are you deploying ? If it is not Mumbai; you can use EFS from AWS.

code deployments on EC2

There are quite a few resources on deployments of AMI's on EC2. But are there any solutions to incremental code updates to a PHP/Java based website?
Suppose I have 10 EC2 instances all running PHP / Java based websites with docroots local to the instance. I may want to do numerous code deployments to it through out the day.
I don't want to create a new AMI copy and scale that up to new instances each time I have a code update.
Any leads on how to best do this would be greatly appreciated. We use subversion as our main code repository and in the past we've simply done an SVN update/co when we were on one to two servers.
Thanks.
You should check out Elastic Beanstalk. Essentially you just package up your WAR or other code file, upload it to a bucket via AWS's command line/Eclipse integration and the deployment is performed automatically.
http://aws.amazon.com/elasticbeanstalk/
Elastic Beanstalk is exactly designed to do this for you. We use the Elastic Beanstalk java/tomcat flavor but it also has support for php, ruby, python environment. It has web console that allows you to deploy code (it even keeps history of it), it also has git tool to deploy code from command line.
It also has monitoring, load balancer, auto scaling all built in. Only a few web form entries to control all these.
Have you considered using a tool designed to manage this sort of thing for you, Puppet is well regarded in this area.
Have a look here:
https://puppetlabs.com/puppet/what-is-puppet/
(No I am not a Puppet Labs employee :))
Capistrano is a great tool for deploying code to multiple servers at once. Chef and Puppet are great tools for setting up those servers with databases, webservers, etc.
Go for a Capistrano . Its a good way to deploy your code on multiple servers .
As already mentioned Elastic Beanstalk is a good option if you just want a webserver and don't want to worry about the details.
Also, take a look at AWS CodeDeploy. You can have much more control over the lifecycle of your instance and you'd be looking at something very similar to what you have now (a set of EC2 instances that you setup). You can even get automatic deployments on instance launch with Auto Scaling.
You can either use Capsitrano or TravisCI.

Drupal with Amazon Web Services?

I'm not sure if this is the write place to ask, but this is the only site I know where I get my questions answered... anyways
I wanted to install drupal but where should I host it? Can amazon web service host this such application? Do I need to go somewhere else and host it? I do have an account with inmotionhosting, but I was thinking if Amazon does the job, why not just use it? Any thoughts and opinions?
You can install Drupal on AWS EC2 if you have sys admin experience. Otherwise you will need to use a managed platform, like Cloudways, for that. Configuring web server like Apache and Nginx, cache like Varnish and Memcached and other features on AWS is little difficult. Many managed servers have those features available in their platform so you don't have to configure anything or go through long process of installing application on AWS.
Amazon Web Services (AWS) will host Drupal no problem.
The service you're looking for is Amazon Elastic Compute Cloud (Amazon EC2). It's pretty much equivalent to a private server with which you can do almost whatever you want (Web hosting included). The downside is that you have to do all the setup yourself.
If you don't know how to install Apache or configure your own Linux machine, you'd probably be better off with managed hosting where they'll set everything up for you.
You can also just use AWS Cloudformation to set up your drupal environment. It's a service that is part of AWS that will set up your stack for you. you may still need to know how to handle your config files but at least you do not have to go into installing the DB , Apache etc all manually.
http://aws.amazon.com/cloudformation/
Bitnami provides a free (Apache-licensed) pre-built Drupal image for AWS that you launch easily. It is great for quickly testing something but if you choose the right instance for your expected load, also for production (disclaimer: I am a cofounder of Bitnami, though as I mentioned the image is open source)
Drupal can be deployed and hosted automatically on Jelastic PaaS. You won't need to configure it from scratch. And if you wish to make some custom settings while installation, you can also easily install it manually. Both variants are described in the guide.
As a result, you'll get automatic scaling, pay-per-use pricing, management via intuitive UI, a wide choice of local service providers from different countries and other options to run your Drupal effectively.