Have been running Docker with Elastic Beanstalk to deploy a relatively simple app, and it has been working great. Now with ECS on the horizon, I am interested to know what the differences are between the two services, and why one might use one over the other?
Amazon's documentation says the following:
Q: How is Amazon ECS different from AWS Elastic Beanstalk?
AWS Elastic Beanstalk is an application management platform that helps customers easily deploy and scale web applications and services. It keeps the provisioning of building blocks (e.g., EC2, RDS, Elastic Load Balancing, Auto Scaling, CloudWatch), deployment of applications, and health monitoring abstracted from the user so they can just focus on writing code. You simply specify which container images are to be deployed, the CPU and memory requirements, the port mappings, and the container links. Elastic Beanstalk will automatically handle all the details such as provisioning an Amazon ECS cluster, balancing load, auto-scaling, monitoring, and placing your containers across your cluster.
Elastic Beanstalk is ideal if you want to leverage the benefits of containers but just want the simplicity of deploying applications from development to production by uploading a container image. You can work with Amazon ECS directly if you want more fine-grained control for custom application architectures.
Related
I have a ASP.NET Core Web API planning to deploy in AWS, I don't have enough background in AWS what is the good package to subscribe in AWS?
My option is Amazon EC2 or Cloud Computing or there is other package for Web API? And my other concern is I also have files to upload by the client need at least of 1 or 2 TB of cloud storage. Can I connect the Cloud Storage services of Amazon to Amazon EC2. I really don't how to start.
You could look at Elastic Beanstalk (EB) as explained in Creating and deploying .NET applications on Elastic Beanstalk. EB is AWS Platform as a Service (Paas) offering which allows you to deploy your code, without managing much or any of EC2 instances, load balancers, security groups and more.
Alternatively, if you can run your app in a docker container, maybe it would be easier to deploy it using ECS Fargate. EB can also be used to deploy dockerized applications.
For storage you can use EFS if you require filesystem-like storage that can be shared across multiple instances, containers or lambda functions.
I understand that ECS has EC2 and Fargate launch types that differ in the control they offer over the underlying environment configuration.
Before Fargate, ECS was used to provide detailed control over the container environment, while Elastic Beanstalk was used to abstract those details and just run the containers.
In the FAQ section of AWS ECS it says:
For Beanstalk, You simply specify which container images are to be deployed, the CPU and memory requirements, the port mappings, and the container links. You can work with Amazon ECS directly if you want more fine-grained control for custom application architectures.
Now with Fargate, it seems that the offered functionality is quite similar. So what are the differences between Fargate and docker on Elastic Beanstalk?
Multi Container Elastic Beanstalk, actually uses ECS to provision your cluster, which make it operate as a Platform-As-A-Service (PaaS) model, as then you can run your images on the cluster it sets up.
Fargate runs on a fully managed server so you dont worry about the cluster or server as you would in Elastic beanstalk. You just manage the Docker container making it more of a Software-As-A-Service (SaaS) model.
I'm planning to use Docker, and associate 1 EC2 instance with 1 Microservice.
Why do I want to deploy Docker in AWS ECS vs. ElasticBeanstalk?
It is said that AWS ECS has a native support to Docker. Is that it?
It would be great if you could be elaborate the pros and cons of running docker on AWS ECS vs. ElasticBeanstalk.
Elastic Beanstalk (multi-container) is an abstraction layer on top of ECS (Elastic Container Service) with some bootstrapped features and some limitations:
Automatically interacts with ECS and ELB
Cluster health and metrics are readily available and displayed without any extra effort
Load balancer must terminate HTTPS and all backend connections are HTTP
Easily adjustable autoscaling and instance sizing
Container logs are all collected in one place, but still segmented by instance – so in a cluster environment finding which instance served a request that logged some important data is a challenge.
Can only set hard memory limits in container definitions
All cluster instances must run the same set of containers
As of ECS IT is Amazon’s answer to container orchestration. It’s a bit rough around the edges and definitely a leap from Elastic Beanstalk, but it does have the advantage of significantly more flexibility including the ability to even define a custom scheduler.
All of the limitations imposed by Elastic Beanstalk are lifted.
Refer these for more info :
Elastic Beanstalk vs. ECS vs. Kubernetes
Amazon EC2 Container Serivce
Amazon Elasticbeanstalk
Is there any PaaS providing from Amazon like Heroku , Pivotal Cloud Foundry, IBM Bluemix?
I know that they have many PaaS helpful services like Amazon RDS for database as a service, Amazon elastic Beanstalk etc which makes blur line between IaaS and Paas concept. but at the end of the day we need to orchestrate all of these thing together. So is there any orchestration providing available from AWS ?
One of the challenges in AWS is that its difficult to draw the line between SaaS, PaaS and IaaS, since there are large number of services available with different functionalities.
However, you can consider AWS Elastic Beanstalk as a PaaS which allows you to provision Web and Database Servers without deeply knowing the underling IaaS aspects of AWS (Though it provisions EC2 instances, Elastic Load Balancers and Autoscaling Groups behind the scene).
If you are planning on using Docker Orchestration, you can consider using AWS ECS as an alternative to docker Swarm.
In addition, there is the AWS Serverless Stack (API Gateway, Lambda) which also can be used to develop applications which is fully managed by AWS.
I keep killing the default instance and it keeps coming back. Why?
This answer is based on the assumption that you are facing a specific issue I've seen several users stumbling over, but your question is a bit short on detail, so I might misinterpret your problem in fact.
Background
The AWS Toolkit for Visual Studio allows you to deploy applications to AWS Elastic Beanstalk, which is a Platform as a Service (PaaS) offering allowing you to quickly deploy and manage applications in the AWS cloud:
You simply upload your application, and Elastic Beanstalk
automatically handles the deployment details of capacity provisioning,
load balancing, auto-scaling, and application health monitoring.
You deploy an application to Elastic Beanstalk into an Environment comprised of an Elastic Load Balancer and resp. Auto Scaling policies, which together ensure your application will keep running even if the EC2 instance is having trouble servicing the requests for whatever reason (see Architectural Overview for an explanation and illustration how these components work together).
That is, your Amazon EC2 instances are managed by default, so you don't need to administrate the infrastructure yourself, but the specific characteristic of this AWS PaaS variation is that you still can do that:
At the same time, with Elastic Beanstalk, you retain full control over
the AWS resources powering your application and can access the
underlying resources at any time.
Now that's exactly what you unintentionally did by terminating the EC2 instance via a mechanism outside of the Elastic Beanstalk service, which the load balancer detects and, driven by those auto scaling policies, triggers the creation of a replacement instance.
Solution
Long story short, you need to terminate the Elastic Beanstalk environment instead, as illustrated in section Step 6: Clean Up within the AWS Elastic Beanstalk Walkthrough (there is a dedicated section for the Elastic Beanstalk service within the AWS Management Console).
You can also do this via Visual Studio, as explained in step 11 at the bottom of How to Deploy the PetBoard Application Using AWS Elastic Beanstalk:
To delete the deployment, expand the Elastic Beanstalk node in AWS
Explorer, and then right-click the subnode for the deployment. Click
Delete. AWS Elastic Beanstalk will begin the deletion process, which
may take a few minutes. If you specified an notification email address
the deployment, AWS Elastic Beanstalk will send status notifications
for the delete process to this address.