-1

I am creating a new EC2 instance in AWS. As I am new to this, i am confused with the AMI.

Current Usage:

  • General Purpose web server
  • Hosting Web API (.net 4.6.2)

Future Needs

  • Need to support .net core as I am planning to migrate the Web API to core
  • Planning to integrate CI/CD with AWS Code pipeline

Environment Selected

  • Instace Type : m5 large

When i check AMI t select i have 2 options:

  • Microsoft Windows Server 2016 Base (I think 2016 is enough)
  • Microsoft Windows Server 2016 Base with Containers

I am confused here. I understood that later have docker containers. But i didn't get the advantage on that in the server. I am planning to learn docker. But as of now, i need your quick help to continue. As i specified, the application may need docker for the build server while configure with Code pipeline.

Please suggest the best option and the needs of that added feature

TylerH
  • 20,799
  • 66
  • 75
  • 101
Akhil
  • 1,918
  • 5
  • 30
  • 74
  • Resource recommendation questions (especially ones that ask for the 'best' something) are off-topic on Stack Overflow because they are opinion-based. – TylerH Sep 06 '22 at 13:30

1 Answers1

1

If you are interested in Docker and plan to run Docker on ECS then you should choose ECS-Optimized Windows Server Amazon Machine Image.

As far you Future Needs it does not depend on AMI but you container do depend on AMI.

This week, we’re adding support for running production workloads in Windows containers using Amazon Elastic Container Service (Amazon ECS). Now, Amazon ECS provides an ECS-Optimized Windows Server Amazon Machine Image (AMI). This AMI is based on the EC2 Windows Server 2016 AMI, and includes Docker 17.06 Enterprise Edition and the ECS Agent 1.16. This AMI provides improved instance and container launch time performance. It’s based on Windows Server 2016 Datacenter and includes Docker 17.06.2-ee-5, along with a new version of the ECS agent that now runs as a native Windows service.

This will help to maintain your ECS services in future also have some advantage over Microsoft Windows Server 2016 Base with out ECS optimized.

  • The ECS agent ran as a process that made it difficult to monitor and manage. As a service, the agent can be health-checked, managed, and restarted no differently than other Windows services.

  • The AMI also includes pre-cached images for Windows Server Core 2016 and Windows Server Nano Server 2016. By caching the images in the AMI, launching new Windows containers is significantly faster

  • The Windows-compatible ECS-optimized AMI also reports CPU and memory utilization and reservation metrics to Amazon CloudWatch.

You can explore more about here

Adiii
  • 54,482
  • 7
  • 145
  • 148
  • Thanks for the response. As of now i knew that we may need to configure docker image in the build step of code pipeline. This new instance used to host my webapi. So please guide me thta any dependencies related to this in Ami selection?.. if no other difference in performance and cost k to go ahead with containers.. – Akhil Sep 04 '19 at 07:43
  • better to push image to ECR and pull image image during pipline from ECR. docker not consume such heavy CPU so better to go with `medium instance` instead of `m5 large`. keep you image on ECR it will be securie and fast to build and push. AWS will charge for instance type not for AMI. So better to go with container based AMI. – Adiii Sep 04 '19 at 07:47
  • One more clarification, if I select base and in future, if I need to change to container (as u mentioned ECS optimized one) any options for that? Sorry if ask very basic – Akhil Sep 04 '19 at 07:47
  • yes, you can change in future but it will require some downtime if you are running once instance. But again I will suggest ECS optimized AMI if you really like to work with ECS. – Adiii Sep 04 '19 at 07:49
  • Thanks so you mean to say we can use t3.medium? For Web API application, 4 GB is fine right – Akhil Sep 04 '19 at 07:54
  • Yes its fine. you can scale up or down you instance after expecing the CPU monitor or memory. Always try to omptimize. – Adiii Sep 04 '19 at 07:58
  • Based on the discussion, i understood that we have 2 instances needed..one is for our regular host and another one need to work as container server. is my understanding right? – Akhil Sep 04 '19 at 08:00
  • 1
    Yes, but you can utilize the same instance too if you want, but better to keep it separate so will be easy to manage – Adiii Sep 04 '19 at 08:01
  • ok great..so i need to create testing server with my general purpose instance (m5.large) and another server which is used for code build is t3.medium.. is my thinking right – Akhil Sep 04 '19 at 08:03
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/198922/discussion-between-akhil-and-adiii). – Akhil Sep 04 '19 at 08:04