Amazon Elastic Compute Cloud (Amazon EC2) is a core offering of Amazon Web Services (AWS) that provides scalable, resizable compute capacity in the cloud. It allows users to rent virtual servers, known as instances, to run applications without the need to invest in physical hardware. Below is an overview of its key features, benefits, and use cases:
Elasticity: Amazon EC2 enables users to scale computing resources up or down based on demand, ensuring cost efficiency and performance optimization.
Instance Types: EC2 offers a wide range of instance types tailored for different workloads, including general-purpose, compute-optimized, memory-optimized, and storage-optimized instances. These instances are powered by various processors like AWS Graviton, Intel Xeon, and AMD EPYC.
Operating Systems: Supports multiple operating systems such as Linux distributions (Ubuntu, Red Hat, SUSE), Windows Server, and more.
Persistent Storage: EC2 integrates with Elastic Block Store (EBS) for scalable block-level storage that can be attached to instances.
Networking: Features like Elastic IP addresses and Virtual Private Clouds (VPCs) allow for secure and customizable networking configurations.
Security: Includes security groups (virtual firewalls), public/private key authentication, and compliance with various security standards.
Pricing Models: Offers flexible pricing options such as On-Demand Instances (pay-as-you-go), Reserved Instances (discounted rates for long-term use), Spot Instances (low-cost unused capacity), and Savings Plans.
Cost Efficiency: Users pay only for the resources they consume, avoiding upfront infrastructure costs45.
Global Reach: Instances can be deployed in multiple geographic regions to optimize latency and ensure redundancy2.
Ease of Use: The AWS Management Console simplifies the process of launching and managing instances3.
High Availability: EC2 supports features like Availability Zones and load balancing for fault tolerance and reliability14.
Hosting web applications or websites.
Running enterprise applications such as databases or ERP systems.
Big data analytics and machine learning workloads.
Development and testing environments.
High-performance computing tasks.
Amazon EC2 has been a foundational service since its launch in 2006 and continues to be widely used for its flexibility, scalability, and integration with other AWS services like S3, RDS, and Lambda.
First, log into the AWS console. Next, search for EC2. Finally, launch an instance.
We will create a web server instance. For this tutorial we are using Ubuntu.
Make sure to use a micro instance and create a new key pair for SSH login.
Since this is a web server, we will allow HTTPS and HTTP traffic.
Ensure that you specify 20 GB of storage. Finally, launch the instance.
The instance should be running.
Let us connect to our instance.
There are numerous ways to connect, but in this tutorial, we will focus on connecting to an EC2 instance using an SSH client.
Once we connect, install NGINX. Also note the public IP address.
To connect, you can also use the Mac/Linux terminal via the SSH client. Ensure that you’ve saved the pem file in your home directory and set its permissions to 400.
Finally, enter the public IP address in the browser’s address bar, and it will display the NGINX page.
Amazon S3 (Simple Storage Service) is a cloud-based object storage service provided by Amazon Web Services (AWS). It is designed for scalability, high availability, security, and performance, making it suitable for a wide range of use cases such as data lakes, backups, disaster recovery, archiving, and big data analytics123.
Object Storage Architecture: Data is stored as objects within buckets. Each object includes the data itself, metadata, and a unique key for identification.
Scalability and Durability: Amazon S3 provides 99.999999999% durability and supports virtually unlimited storage capacity. It also supports 99.99% availability by default.
Security: Offers features like encryption (at rest and in transit), access control policies, and integration with AWS security services like IAM, CloudTrail, and Macie.
Data Access: Supports REST APIs, SDKs, and tools like AWS CLI for data transfer. Features such as pre-signed URLs allow temporary access to objects23.
Versioning: Enables multiple versions of an object to be stored for recovery purposes5.
Lifecycle Management: Automates data movement between storage classes based on predefined rules to optimize costs5.
Amazon S3 provides various storage classes tailored to different access patterns and cost requirements:
File Size: Objects can range from 0 bytes to 5TB. Files larger than 5GB must use multipart upload.
Access Control Granularity: Access control is applied at the bucket or object level but lacks finer-grained controls like POSIX permissions.
Amazon S3 pricing includes charges for storage volume, requests (e.g., GET/PUT), and data transfer. The AWS Free Tier provides limited free usage during the first 12 months.
Amazon S3 is widely used across industries due to its flexibility, integration with other AWS services, and ability to handle diverse workloads efficiently.
From the AWS console, locate the S3 service. Next, create a new bucket.
Once we create the bucket, we can upload files to it.
Once the files are uploaded, we can modify the Access Control List (ACL) for each file. Since we want the public to access to files, we need to set the read permission for everyone.
Finally, after setting the permissions, we can share the object’s URL with the public.
AWS Lambda is a serverless compute service provided by Amazon Web Services (AWS) that allows developers to run code without provisioning or managing servers. It operates on an event-driven model, automatically managing the underlying compute resources required to execute code in response to specific triggers or events, such as HTTP requests, file uploads, or database updates.
Serverless Architecture: Developers can focus on writing code without worrying about infrastructure management. AWS handles server maintenance, scaling, and patching.
Event-Driven Execution: Lambda functions are triggered by events from other AWS services like S3, DynamoDB, or API Gateway, enabling seamless integration across the AWS ecosystem.
Automatic Scaling: Lambda scales automatically based on the number of incoming requests, handling from a few events per day to thousands per second. It also scales down to zero when idle, ensuring cost efficiency.
Support for Multiple Languages: AWS Lambda supports Node.js, Python, Java, Go, .NET, Ruby, and custom runtimes through its Runtime API.
Stateless Functions: Functions run in isolated environments and are stateless by design. Persistent data is managed using external services like DynamoDB or S3.
Provisioned Concurrency: For latency-sensitive applications, this feature ensures functions remain initialized and ready to respond quickly.
Cost Efficiency: You pay only for the compute time used (billed in 1ms increments). There are no charges when the code is not running.
High Availability: Lambda functions run on fault-tolerant infrastructure across multiple Availability Zones2.
Ease of Use: Functions can be created and managed via the AWS Management Console, CLI, SDKs, or frameworks like AWS SAM.
Security: Built-in integration with AWS Identity and Access Management (IAM) ensures secure access to resources. Functions also run within Amazon VPCs for additional security.
Web and Mobile Backends: Build scalable APIs using Lambda with API Gateway.
Data Processing: Process real-time data streams from services like Kinesis or S3.
Automation: Automate tasks such as backups or system monitoring.
Machine Learning: Run lightweight ML inference workloads using containerized models.
AWS Lambda simplifies application development by abstracting server management while offering scalability and cost efficiency for event-driven workloads.
First, we locate Lambda in the AWS console. Next, we create a function.
We’ll create a program from a blueprint. To do this, we’ll use the “hello world” function, which is running Python 3.10.
After that, we make the necessary modifications to the code. Please ensure that you click the deploy button.
Next, we integrate our function with the Amazon API Gateway to connect it to the web.
We select the lambda function we’ve created, which is named as mscfunc in this example.
We could use the GET method to access the function.
Finally, when you click on the link, insert a slash (/) and enter the function name you’ve created. Next, add parameters to the function. For instance, the URL would look like this: https://….amazonaws.com/mscfunc?name=Test&age=23