WHAT IS EC2?
EC2 (Elastic Cloud Compute) is one of the most widely used and one of the most popular services that AWS provides. It allows users to rent virtual computers on which to run their own computer applications; it is elastic in nature, and because of that, it allows scalable deployment of applications by providing flexible and on-demand computing capacity.
EC2 instance types and their primary use cases:
-
General Purpose: These instances offer a balanced mix of compute, memory, and networking resources, making them suitable for a wide range of applications, such as web servers and databases. Examples include:
- M4, M5, M5n, M5zn, M6a, M6g, and M6i
-
Compute Optimized: These instances are designed for workloads that require high-performance processing, such as batch processing, scientific simulations, and high-traffic web servers. Examples include:
- C4, C5, C5n, C5a, C6a, C6g, and C7g
-
Memory Optimized: These instances are ideal for workloads that require large amounts of memory, such as databases, data analytics, and caching. Examples include:
- R4, R5, R5b, R5n, X1, X1e, and z1d
-
Storage Optimized: These instances are designed for workloads that require high-performance storage, such as databases, data warehouses, and file systems. Examples include:
- I3, I3en, D2, and H1
-
Accelerated Computing: These instances use hardware accelerators, such as GPUs, FPGAs, or ASICs, to accelerate specific workloads, such as machine learning, scientific simulations, and data analytics. Examples include:
- P2, P3, P4, G4, F1, and Inf1
Some key features of EC2:
- Virtual Machines: EC2 provides virtual machines, known as instances, which can be used to run applications.
- Scalability: EC2 allows users to scale up or down to handle changes in workload or traffic.
- Flexibility: EC2 provides a range of instance types, including different sizes, types, and configurations.
- On-demand: EC2 provides on-demand computing capacity, allowing users to quickly deploy and terminate instances as needed.
- Security: EC2 provides a secure environment for running applications, with features such as firewall rules, access controls, and encryption.
- Integration: EC2 integrates with other AWS services, such as S3, RDS, and VPC, to provide a comprehensive cloud computing platform.
EC2 instances use case:
- Web servers: Running web servers, such as Apache or Nginx.
- Databases: Running databases, such as MySQL or PostgreSQL.
- Application servers: Running application servers, such as Tomcat or JBoss.
- Batch processing: Running batch processing jobs, such as data processing or scientific simulations.
- Machine learning: Running machine learning workloads, such as training models or making predictions.
Step-by-step guide to creating and deploying application
Log into the browser and search for AWS Console.
Create your account.
Log into the account after the creation. You will see something like the environment below.
in the search box, search for EC2 and select Virtual Servers in the Cloud.
To create an instance, you will see Launch instance at the top right side or scroll down, You will see Launch instance, then click on it.
click the box and give your instance a name e.g my "project"
click the Add additional tags button to add a tag to the instance. Tags are important and a good practice for identification.
on the top right side you will see Stockholm click on it and choose Region.
Note: Why choose Region and availability zones The choice of region is important because of theseCompany/government policy: the company may have a restriction that they don't want to put their data outside their country or zone
Latency: Latency is the time it takes for the request to reach an application and for the application and server to send a response back to you, if there is a delay that means there is high Latency, if there is no delay it means there is low Latency. For low Latency, creating your instance in the nearest availability zone is recommended.
Availability zone: to avoid downtime it is recommended to put your application in two availability zones so that if one is down the other will be working.
Scroll to the Application or OS image region to select the type of Image suitable for your operation
- Select the kind of Instance that won't cost so much
- Create a Key Value Pair by clicking on create and provide a name Note: The key-value pair or key pair is the most important thing and this key pair is the one that helps us to log into the instance, by default when you create an instance AWS does not provide your password, the password authentication to the instance is disabled by default the only way you can log into the instance is using key-value pair, what is key-value pair, it is the combination of the public-private key which you used to log into a specific instance, so the instance has a public key you will have the private key, using the private key you will log into the instance.
- On the Network Security, Select Allow HTTP from the internet
- On the Configure Storage, you can increase the memory.
- Click the Launch icon.
Click on upload a private key file.
- Click on the Key Pair Downloaded and Open.
- After the Download of the Key Pair, Decrypt the Password.
- The Password after being Decrypt. Copy it, and Go to RDP File that has been downloaded to connect the EC2 Instance.
- This is your instance environment.
- on the search bar search for PowerShell in the EC2 instance environment, and run it as an Administrator.
- On the PowerShell terminal install IIS webserver by running install-WindowsFeature -Name Web-Server -IncloudeManagementTools
- Return to the instance you created copy your Public IP address and paste it into Browser.
- The environment of the Browser.
Conclusion
By completing the steps in this guide, you have successfully set up a Windows EC2 instance on Amazon Web Services (AWS) and installed the Internet Information Services (IIS) web server. This accomplishment showcases the versatility and capabilities of AWS, providing a solid groundwork for hosting web applications in a cloud environment. With your IIS server now operational, you can proceed to customize configurations, deploy websites, and scale your instance as needed to accommodate increasing demands
Top comments (0)