0% found this document useful (0 votes)
13 views5 pages

AWS EC2 Budget and Instance Overview

The document provides an overview of AWS Budgets for cost management and Amazon EC2, a scalable cloud service for running applications. It details various EC2 instance types, security groups, SSH usage, instance purchasing options, and Spot Instances for cost-effective computing. Additionally, it explains how to manage EC2 permissions with IAM roles and offers insights into pricing models and IP address charges.

Uploaded by

lahu.kokare07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views5 pages

AWS EC2 Budget and Instance Overview

The document provides an overview of AWS Budgets for cost management and Amazon EC2, a scalable cloud service for running applications. It details various EC2 instance types, security groups, SSH usage, instance purchasing options, and Spot Instances for cost-effective computing. Additionally, it explains how to manage EC2 permissions with IAM roles and offers insights into pricing models and IP address charges.

Uploaded by

lahu.kokare07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

AWS & EC2 Summary Guide

AWS Budget Setup


 AWS Budgets lets you set custom cost and usage budgets.
 Can send alerts via email or SNS when thresholds are exceeded.
 Budgets can be created for cost, usage, reserved instances, and savings plans.
 Help with cost control and forecasting.

EC2
 Amazon EC2 (Elastic Compute Cloud) is a cloud service that provides scalable virtual
servers (instances) to run applications without needing physical hardware.
 It supports flexible compute capacity, allowing users to launch, stop, and scale instances
on demand.
 EC2 integrates with other AWS services and offers multiple pricing options to suit
different workloads and budgets.

EC2 Basics
 EC2 = Elastic Compute Cloud, scalable virtual servers.
 Instances can be launched with different OS (Linux, Windows).
 Key concepts: AMI, instance type, key pair, security group, EBS.

EC2 Instance Types Basics


General Purpose (t3, t4g, m6i)
 Balanced compute, memory, and networking resources.
 Ideal for web servers, development environments, and small databases.

Compute Optimized (c5, c6g)


 High-performance processors for compute-intensive tasks.
 Great for gaming servers, high-performance web servers, and scientific modelling.

Memory Optimized (r5, r6g, x2idn)


 Designed for workloads that require large amounts of memory.
 Best for in-memory databases, big data analytics, and real-time processing.

Storage Optimized (i3, i4i, d3)


 High IOPS and throughput for large local storage.
 Suitable for NoSQL databases, data warehousing, and high-speed storage needs.

Accelerated Computing (p4, inf1, g5)


 Equipped with GPUs or specialized chips.
 Used for machine learning, AI inference, graphics rendering, and HPC.

 Each type varies in CPU, memory, storage, and network.

Security Groups & Classic Ports Overview


 Security Groups are virtual firewalls that control inbound and outbound traffic for
AWS EC2 instances.
 They use rules to allow (but not deny) traffic based on protocol, port number, and
source/destination IP.
 Security groups are stateful—if an incoming request is allowed, the response is
automatically permitted.
 Acts as a virtual firewall at the instance level.
 Controls inbound and outbound traffic using rules.
 Common ports:
- 22: SSH
- 80: HTTP
- 443: HTTPS
SSH Overview
 Secure Shell (SSH) is used for remote login.
 Requires a key pair (private & public).
 Connect using SSH clients from your terminal or tool.

How to SSH using Linux or Mac


 Use terminal with the command:
ssh -i /path/[Link] ec2-user@public-ip
 Ensure file permission is correct:
chmod 400 [Link]

How to SSH using Windows / Windows 10


 Use PuTTY or Windows PowerShell.
 For PuTTY:
- Convert .pem to .ppk using PuTTYgen.
- Load .ppk in PuTTY and connect.
 For PowerShell:
ssh -i path\[Link] ec2-user@public-ip
SSH Troubleshooting
 Check:
- Correct public IP
- Security group allows port 22
- Key file permissions
- Using correct user (e.g., ec2-user)
- Instance is running and reachable

EC2 Instance Connect


 Browser-based SSH via AWS Console.
 No need for key pair.
 Works only for Amazon Linux and Ubuntu with supported AMIs.

EC2 Instance Roles Demo


 Attach IAM roles to EC2 for permission management.
 No need for access keys in the instance.
 Secure way for EC2 to access AWS services (e.g., S3, DynamoDB).

EC2 Instance Purchasing Options


On-Demand Instances
 Pay-as-you-go model with no upfront payment or long-term commitment.
 Ideal for short-term workloads, testing, or unpredictable usage.
 Highest cost per hour but maximum flexibility.

Reserved Instances (RIs)


 Commit to using EC2 for 1 or 3 years in exchange for a significant discount (up to
75%) compared to On-Demand.
 Choose between Standard RIs (greater discount) and Convertible RIs (more flexibility
in instance type).
 Best for steady-state workloads.

Spot Instances
 Purchase unused EC2 capacity at up to 90% lower cost than On-Demand.
 Can be interrupted by AWS with short notice if capacity is needed elsewhere.
 Suitable for fault-tolerant and flexible workloads like batch processing, CI/CD, big
data jobs.

Savings Plans
 Flexible pricing model that offers savings up to 72% over On-Demand, based on
commitment to a consistent amount of usage (e.g., $/hour) for 1 or 3 years.
 Two types:
 Compute Savings Plan: More flexibility across instance families, regions, and OS.
 EC2 Instance Savings Plan: Less flexible but offers higher savings.
 IP Address Charges in AWS
 Public IP: No charge when associated and instance is running.
 Elastic IP:
- Free when associated and used.
- Charged when unattached or associated with stopped instance.

Spot Instances & Spot Fleet


Spot Instances:
 Low-cost EC2 option that lets you use unused AWS capacity at up to 90% discount
compared to On-Demand pricing.
 Suitable for fault-tolerant, flexible workloads like data processing, testing, machine
learning, or CI/CD jobs.
 Can be interrupted by AWS with a 2-minute notice when capacity is needed for On-
Demand users.

Spot Fleet:
 A management tool that allows you to launch and maintain a mix of Spot and On-
Demand Instances to meet a desired capacity.
 Spot Fleet chooses the most cost-effective combination based on pricing and
availability across instance types and AZs.
 Ideal for scaling large workloads while optimizing cost and availability.

Common questions

Powered by AI

Troubleshooting SSH connectivity issues with AWS EC2 instances involves several checks: ensuring the correct public IP address is used, verifying that the security group permits traffic on port 22, checking key file permissions are set correctly, confirming the correct username (e.g., ec2-user) is used, and ensuring the instance is running and reachable . These checks are crucial because each configuration error can prevent successful SSH connections, implicating security, instance availability, and access control management .

Amazon EC2 provides scalable and flexible computing resources by allowing users to launch, stop, and scale virtual server instances on-demand without the need for physical hardware. This flexibility is achieved through a variety of instance types that cater to different workloads such as general-purpose, compute-optimized, memory-optimized, and storage-optimized instances . Compared to traditional physical servers, EC2 offers the advantage of paying only for what is used through models like On-Demand and Spot Instances, reducing costs and eliminating the need for upfront capital expenditure . This model also provides elasticity for businesses to scale their applications quickly in response to demand changes, which is not possible with fixed physical server infrastructures .

AWS provides mechanisms such as AWS Budgets, Reserved Instances, and Savings Plans to manage and contain cloud service costs. AWS Budgets allow users to set customized cost and usage budgets, providing alerts via email or SNS when thresholds are exceeded, helping with cost control and forecasting . Reserved Instances enable users to commit to using EC2 for one or three years at a significant discount (up to 75%) compared to On-Demand prices, which is beneficial for steady workloads . Savings Plans offer flexible pricing with discounts up to 72% based on commitment to a consistent amount of usage, providing options for either Compute Savings Plan or EC2 Instance Savings Plan .

EC2 On-Demand Instances offer maximum flexibility and are ideal for web applications with fluctuating traffic as they require no long-term commitment and allow users to pay per use, making them suitable for unpredictable workloads . The downside is their higher cost per hour compared to other pricing models. Conversely, Reserved Instances provide up to 75% cost savings for steady-state applications by committing to a one or three-year term, but they lack the flexibility to quickly adapt to traffic fluctuations, potentially leading to over-provisioning or underutilization if traffic decreases below capacity .

Different EC2 instance types are optimized for specific workloads by balancing resources such as compute, memory, and storage. General Purpose instances are suitable for web servers and development environments, providing balanced resources . Compute-optimized instances use high-performance processors, ideal for compute-intensive applications like gaming servers . Memory-optimized instances cater to memory-intensive tasks, like in-memory databases, by providing large memory capacity . Storage-optimized instances are designed for high IOPS storage needs, such as NoSQL databases , and Accelerated Computing instances support GPU and AI workloads, suitable for machine learning . Deployment strategies should consider workload characteristics to select the most efficient instance types, ensuring cost-effectiveness and performance alignment with application requirements.

Choosing an Elastic IP provides a static IP address for an EC2 instance, which persists across instance stops and starts, facilitating consistent endpoint access and aiding in DNS configurations. Elastic IPs are free when associated with a running instance but incur charges when unattached or connected to a stopped instance, whereas public IPs are dynamic and associated with running instances at no additional cost . The cost considerations include potential charges for unattached Elastic IPs, while the tactical benefit of having a static IP might outweigh costs for applications needing consistent IP addresses or requiring DNS records .

AWS Spot Instances are most advantageous in scenarios where workloads are fault-tolerant, flexible, and can handle interruptions, such as data processing, machine learning, or continuous integration/continuous deployment (CI/CD) tasks. They offer significant cost savings of up to 90% compared to On-Demand pricing by utilizing unused EC2 capacity . However, the potential risks include interruptions by AWS within a two-minute notice if the capacity is needed for On-Demand users, which requires applications to be designed with fault tolerance and quick recovery capabilities .

Security groups in AWS EC2 act as virtual firewalls for instances, controlling inbound and outbound traffic with rules based on protocol, port number, and source/destination IP . They differ from traditional firewalls by being stateful, meaning that if an incoming request is allowed by the security group rules, the response is automatically permitted. Traditional firewalls are typically stateless, requiring explicit configuration for both incoming and outgoing traffic. Security groups operate at the instance level rather than the network level, providing more granular and precise control over access to individual virtual instances .

The integration of IAM roles with EC2 instances enhances security and ease of access by allowing instances to interact with AWS services without requiring access keys. IAM roles assigned to an instance grant temporary security credentials, which securely manage permissions and the access an instance has to other AWS services such as S3 or DynamoDB, without embedding long-term credentials in the instance. This reduces the risk of key compromise and simplifies security management by centralizing permission changes within IAM roles instead of modifying code or instance configurations .

EC2 Instance Connect offers several advantages over traditional SSH methods by providing a browser-based SSH access method that does not necessitate the use of key pairs. This simplifies the connection process by removing the need to manage SSH key pairs or configure network parameters for users, thus enhancing security by offering controlled access via IAM policies. It's especially useful for quick administrative access without pre-configuring SSH clients, although it's limited to Amazon Linux and Ubuntu with supported AMIs, which could be a constraint compared to traditional SSH methods .

You might also like