AWS application source bundle deployment - amazon-web-services

I am deploying multiple web applications to a single elastic beanstalk tomcat instance using application source bundle. I have two applications app1, app2 in the tomcat. Now I want to make some changes to app2 and redeploy only app2 and not touch app1, how do I do that?
If I deploy again with source bundle with only app2, app1 is getting deleted.
My aim is to have multiple web apps in the same tomcat with the ability to update only the required web apps.
Thanks

You have to redeploy everything. If you want control over deployment for an individual service then you might want to separate them into two different elastic beanstalk applications.
This was an annoying limitation and one of the reasons my employer moved away from elastic beanstalk.

Related

Is it possible to deploy multiple spring-boot applications in AWS Beanstalk using the same EC2 instance?

I have an application that is composed of multiple spring boot microservices and a front end application using vue.js, and I want to deploy them in AWS beanstalk to avoid handling infraestructure.
I know how to deploy a single microservice into beanstalk, but I dont want to have as many beanstalk instances as microservices I have, because I don't have the money to pay for many service instances.
So my question is: How to deploy multiple spring boot applications and the vue.js application into only one beanstalk instance?
Thank you.
Elastic beanstalk accepts zip files. You can zip 2 or more war files and upload as a zip. Importantly among the zipped files, one has to be the root war, so that base url has one application to point to.
Below documentation should give you more details
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-tomcat-multiple-war-files.html

How does Django deployments happen on Servers?

I learnt how to deploy the django projects to EC2 instances.
Basically 1st time when the django project is deployed to EC2, the instance will be configured with httpd.conf, wsgi, change permissions on files and folders and other stuff and the project will be cloned to the EC2 instance and server is restarted.
My question is how do they do future deployments? They in this context is anyone who deploys Django on EC2 instances.
Do they login to EC2 instances and manually clone the repository from VCS site and restart the server?
Do they have any other automated mechanism to pull the code, ensure permissions and restarting the apache server etc.
How is it done basically every time they go for a release?

Deploying a web application for Selenium testing on AWS EC2

I have a web application that uses Selenium in backend to run few scripts when invoked by user. I want to deploy this web app on AWS.
Here are my findings so far:
I can have a windows EC2 instance created and then I can install tomcat, firefox and all the necessary stuff. Then using putty or any other client, I can deploy my war and start tomcat.
I can directly make use of Elastic Beanstalk and deploy my war file there itself but then, there is no windows EC2 available for beanstalk and I don't know how to install firefox there and make my application work.
What is the best way to achieve this and what steps should I follow. I want to install a specific firefox version to be able to make it run with my selenium scripts.
There are two separate things here:
Deployment of web application on AWS cloud
Run the selenium tests against your web application
According to me, you should first think of deploying a web application to AWS cloud. There are many ways by which you can get it deployed to AWS cloud with below services:
Spin a new AWS EC2 instance, install all required software and deploy the web application.
Use AWS elastic beanstalk service with either with tomcat or docker.
Use AWS ECS if you prefer docker
According to me, second option will be quick for you with tomcat environment option. If you select tomcat environment, then your platform will be Tomcat 8 Java 8 on 64bit Amazon Linux.
Now, here comes the second part. You can have below options for your browser environments.
Spin a new separate AWS EC2 instances with correct AMI and install your specific browsers on these instances.
If you prefer SaaS, then you can take a look at browserstack or SauceLabs for remote environment.
If you have CI(jenkins/travis/Circle CI), then make use of that infrastructure to luanch your tests with either option from the above.

AWS ECS Production Docker Deployment

I've recently started using Docker for my own personal website. So the design my website is basically
Nginx -> Frontend -> Backend -> Database
Currently, the database is hosted using AWS RDS. So we can leave that out for now.
So here's my questions
I currently have my application separated into different repository. Frontend and Backend respectively.
Where should I store my 'root' docker-compose.yml file. I can't decide to store it in either the frontend/backend repository.
In a docker-compose.yml file, Can the nginx serve mount a volume from my frontend service without any ports and serve that directory?
I have been trying for so many days but I can't seem to deploy a proper production with Docker with my 3 tier application in ECS Cluster. Is there any good example nginx.conf that I can refer to?
How do I auto-SSL my domain?
Thank you guys!
Where should I store my 'root' docker-compose.yml file.
Many orgs use a top level repo which is used for storing infrastructure related metadata such as CloudFormation templates, and docker-compose.yml files. So it would be something like. So devs clone the top level repo first, and that repo ideally contains either submodules or tooling for pulling down the sub repos for each sub component or microservice.
In a docker-compose.yml file, Can the nginx serve mount a volume from my frontend service without any ports and serve that directory?
Yes you could do this but it would be dangerous and the disk would be a bottleneck. If your intention is to get content from the frontend service, and have it served by Nginx then you should link your frontend service via a port to your Nginx server, and setup your Nginx as a reverse proxy in front of your application container. You can also configure Nginx to cache the content from your frontend server to a disk volume (if it is too much content to fit in memory). This will be a safer way instead of using the disk as the communication link. Here is an example of how to configure such a reverse proxy on AWS ECS: https://github.com/awslabs/ecs-nginx-reverse-proxy/tree/master/reverse-proxy
I can't seem to deploy a proper production with Docker with my 3 tier application in ECS Cluster. Is there any good example nginx.conf that I can refer to?
The link in my last answer contains a sample nginx.conf that should be helpful, as well as a sample task definition for deploying an application container as well as a nginx container, linked to each other, on Amazon ECS.
How do I auto-SSL my domain?
If you are on AWS the best way to get SSL is to use the built in SSL termination capabilities of the Application Load Balancer (ALB). AWS ECS integrates with ALB as a way to get web traffic to your containers. ALB also integrates with Amazon certificate manager (https://aws.amazon.com/certificate-manager/) This service will give you a free SSL certificate which automatically updates. This way you don't have to worry about your SSL certificate expiring ever again, because its just automatically renewed and updated in your ALB.

Deploy multiple applications to a single EC2 instance using AWS Elastic Beanstalk

I am have deployed a .Net website to AWS Elastic Beanstalk. I want to now deploy another .Net web project (a web service) to the same EC2 instance that was created by AWS Elastic Beanstalk, but the selection to "use and existing environment" in the Environment page of the publishing wizard is greyed out.
Is there a way to do this?
Update: This is now possible https://aws.amazon.com/about-aws/whats-new/2016/08/aws-elastic-beanstalk-supports-asp-net-core-and-multi-app-net-support/
No. .Net deployment has some limitations on EB compared to the other frameworks. You cannot deploy multiple applications on the same instance.
You can use Multicontainer docker environment to deploy multiple applications http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_ecs.html
You cannot deploy a "Web Site" and a "Web Application" on the same instance (or set of instances, such as that formed by ElasticBeastalk) because they run different resources and policies. This is accordingly to the tutorial i came across on their site.
Maybe this package can help you running multiple apps/websites on a single Elastic Beanstalk instance (Apache): https://github.com/tscheiki/ElasticDeploy
You can also do a multiple-app deployment using the Visual Studio AWS Toolkit:
docs.aws.com/toolkit-for-visual-studio
This is how to do it for Tomcat environments - https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/java-tomcat-multiple-war-files.html.
To create an application source bundle that contains multiple WAR files, organize the WAR files using the following structure.
MyApplication.zip
├── .ebextensions
├── .platform
├── foo.war
├── bar.war
└── ROOT.war
When you deploy a source bundle containing multiple WAR files to an AWS Elastic Beanstalk environment, each application is accessible from a different path off of the root domain name. The preceding example includes three applications: foo, bar, and ROOT. ROOT.war is a special file name that tells Elastic Beanstalk to run that application at the root domain, so that the three applications are available at http://MyApplication.elasticbeanstalk.com/foo, http://MyApplication.elasticbeanstalk.com/bar, and http://MyApplication.elasticbeanstalk.com.