Deploying Web application onto AWS from a Git repository - java

I worked with OpenShift and was able to deploy the Java Tomcat web application from a git (bitbucket) repository URL. Another good option was using rhc.
I am new in AWS and need to deploy the Tomcat Web application onto AWS. I cannot find neither the option to upload from a git repository (bitbucket) nor the a shell command interface. Are there any options?
I received some answers that it is possible both from AWS Elastic Beanstalk GUI and from eb. However, I cannot find how to do this, so it would be nice to get the answer in details. How to get to the screen asking the GIT URL? What is the eb command?

It sounds like you were using OpenShift v2 and now you want to migrate to AWS. The AWS Elastic Beanstalk service is a PaaS that should be very similar to what you are used to using with OpenShift v2. Elastic Beanstalk has an eb command that is similar to the rhc command, and Elastic Beanstalk can trigger deployments from Git, very similar to how OpenShift v2 deployments worked.

Related

How to host spring-boot micro-service dockerized(docker compose) application on Heroku

I have developed small spring-boot microservice application and dockerized the same. I have multiple spring-boot services and angular which are dockerized using docker-compose file. My app runs fine in my local. I just wanted to host my app on Heroku for free. please help me how to host my app and how to configure multiple ports with application. how to deploy using docker-compose.
First of all, you can not run your docker-compose in heroku.
Docker is not required
If you will choose heroku, docker is not required. Just ensure that your spring boot apis and angular app are standard. If you fulfill that, just create many applications as git repositories you have (I guess you have it like this).
Smart heroku engine will detect the technology of your git repository and will provide you an standard dyno for your app. After that heroku will run standard commands of open source languages.
For example, heroku will run npm install and npm run start in your angular/nodejs app. If you don't put the start script in your package.json, an error will be trowed. The same will happen with your spring boot rest api.
If you have any error with your current spring boot apis, try to compare it with my templates https://github.com/jrichardsz/spring-boot-templates/tree/master/000-hello-world.
I want docker
Anyway, if you want to use docker in heroku, just put the classic Dockerfile inside of any git repository and push them to heroku. Smart engine will detect it and deploy it.
1.You don't need docker as answered already. See this link for deployment to Heroku
You could also deploy using Travis CI for continuous integration via github.

How to install/run Spark Java Framework on AWS Elastic Beanstalk?

Normally, I build a Java web app using Tomcat or Glassfish into a WAR (web app archive file). This file can easily be deployed into AWS through Elastic Beanstalk with a few clicks. The integration is simple because Elastic Beanstalk allows us to deploy a web app on Tomcat/Glassfish/Java.
I recently started using a lightweight java framework called Spark, www.sparkjava.com . Is it possible to deploy this on Elastic Beanstalk in a few clicks? If not, is there an alternative to easily deploy a Spark Java web app onto AWS? Or, would I need to create an EC2 instance, copy the JAR app, and launch the JAR web app via command line?
Sure you can, either by deploying it as a war via the Tomcat platform, or run it as a fat jar via the Java SE platform.
I published an Archetype for AWS Elastic Beanstalk that uses DropWizard instead of Spark (but both use Jetty) - It should be pretty straightforward to adapt it to Spark. Note it uses the Docker Solution Stack (more flexible and easier to debug locally). This command should get you started:
$ mvn archetype:generate -Dfilter=elasticbeanstalk-docker
Also, AWS allows you to create a custom Java Application, like #k.liakos said in his answer.

How to upload Servlet/JSP website through Amazon Web Services?

I am working on a Servlet/JSP project and I want to host it on aws.amazon.com. I have already signed up for Amazon Web Services and after signing in this page opens up and I have no idea what to do or which option to select.
I think AWS provides a lot of customization with a lot advanced technical options to choose from, but this is difficult for beginners who just want to make their site running.
My project will use these:-
JSP/Servlets
CSS
MySQL
Struts2
Tomcat WebServer
I would suggest these approaches to study:
Elastic BeanStalk - This is AWS simply hosting model. If you're not IT savy you should pursue this approach
EC2 with MySQL RDS - In this case you'll create a Virtual Machine(s) (EC2) install Tomcat and other dependencies and deploy your app. You'll then use RDS to store your data (which is MySql as a service)
EC2 only - YOu'll do the same as 2. but install your own instance of MySql. There may be AMI's offered that you can provision that will meet your application requirements.
Other reading:
Route53 if your going to use AWS for your domain records
Elastic Load Balancing if your going to need High Availability
Elastic Block Store if you want persistent disks accross VMs
Network Security Groups to secure your VMs (for 1. and 2.)
Virtual Private Cloud for additional security
CloudFormation if you want to automate provisioning
There are many articles on: AWS Architecture
There is a eclipse plugin for Amazon web services.
The AWS Toolkit provides an AWS Java web project template for use in Eclipse. The template creates a web tools platform (WTP) dynamic web project that includes the AWS SDK for Java in the project's classpath. Your AWS account credentials and a simple index.jsp file are provided to help you get started. The following instructions assume you have installed both the Eclipse IDE for Java EE Developers and the AWS Toolkit plug-in. For more information, see Setting Up the AWS Toolkit for Eclipse.
Also check this & this
I would recommend 1st approach using Beanstalk to deploy your jsp application. There you are going to leverage all the advantages of AWS like load balancing, auto scaling, ddb and DW support and many other technologies. With Beanstalk you setup dev environment on your local machine and deploy the changes in AWS and once setup is done you are done...
May be you will need to spend some time on migrating from MySQL but that will be work on longer duration when you are going to have lot of users.

Amazon Web Service Deployment - free tier

I'm trying to use the AWS free tier for host a java web application. I created an EC2 instance but i don't figure out how can I deploy the application to this instance. I was trying to use the AWS Toolkit for eclipse to deploy the web site to Elastic Beanstalk, but from here i need a second tier to deploy the application to the production.
My question is: What is the free solution to make a deploy to my EC2 instance and how?
Thank you!
If you are using Elastic Beanstalk ( which I recommend), then you should create the Beanstalk stack manually from the AWS console. Before you do that, I suggest you to terminate your other instance, because you wont use that.
The beanstalk stack will create an EC2 instance in the background, also an RDS database if you ask for it. You pay for the resources ( EC2, RDS), but no extra cost for the "Beanstalk stack".
After you having the Beanstalk stack, you can deploy it with the Eclipse plugin, or just simply generate the WAR file and upload it via the AWS console. ( On the Beanstalk page there is a place to upload a war file for deployment.)
Be aware to set the DB connection details to the RDS ( if you are using it).
Also note that the free tier is nice to warm up but not recommended for production.
When you create the Beanstalk stack make sure you create a single AZ web frontend, so you will have only 1 webserver running.

publishing and hosting the webservice on cloud

I have web service that is up and running that is in other words it is publish on my tomat on port 8080 and I can hit it through my browser now I want that my webservice to be get published on cloud so that I can pass wsdl uri to any one in the world and he can access my wsdl. Please advise how to achieve this ..!!will Amazon provide such facilities.
I've tried various options and Amazon's Elastic Beanstalk is the most seamless. You can launch your Java webservice by simply uploading a war. However, it does require an EC2 instance to be running.
Other options are Heroku and Windows Azure
Heroku has a free tier and uses Maven/Git to deploy the app to their server. https://devcenter.heroku.com/articles/deploy-a-java-web-application-that-launches-with-jetty-runner
Windows Azure also has instructions on how to deploy a java webapp on their platform. http://www.windowsazure.com/en-us/develop/java/
Given these options, In my personal opinion, the cheapest is Heroku and the most convinient is Amazon Elastic Beanstalk.

Categories