Amazon EC2 (Elastic Compute Cloud)Compute

ACG LINK

Amazon EC2: Overview and Configuration Example.

Amazon Elastic Compute Cloud (EC2) is a web service offered by Amazon Web Services (AWS) that provides resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. EC2 allows users to rent virtual servers, known as instances, on which they can run their applications. Here's a detailed description of Amazon EC2, including its features and a configuration example:

Features of Amazon EC2

  1. Instances:

    • EC2 provides a variety of instance types optimized for different use cases, such as compute-optimized, memory-optimized, storage-optimized, and GPU instances.
    • Instances can run various operating systems, including Amazon Linux, Windows, and others.
  2. Elastic Load Balancing:
    • Distributes incoming application traffic across multiple instances to ensure no single instance is overwhelmed.
    • Improves fault tolerance of your applications.
  3. Auto Scaling:
    • Automatically adjusts the number of EC2 instances based on traffic demand or predefined schedules.
    • Ensures optimal performance and cost efficiency.
  4. Amazon Machine Images (AMIs):
    • Pre-configured templates for instances, including the operating system and other software.
    • Users can create custom AMIs to capture their own configurations.
  5. Security Groups:
    • Acts as a virtual firewall for your instances, controlling inbound and outbound traffic.
    • Allows you to specify rules for traffic based on protocols, ports, and source/destination IP addresses.
  6. Key Pairs:
    • Enables secure access to instances using SSH (for Linux instances) or RDP (for Windows instances).
    • Users must have the private key to log in securely.
  7. Elastic Block Store (EBS):
    • Provides scalable and persistent block-level storage volumes for use with EC2 instances.
    • Can be used for boot volumes or additional data volumes.
  8. Amazon S3 Integration:
    • Instances can access data stored in Amazon Simple Storage Service (S3) for scalable and durable object storage.
  9. Instance Metadata and User Data:
    • Allows instances to access metadata about themselves (e.g., instance ID, public IP) and user-defined data during launch.
  10. Amazon CloudWatch:
    • Monitors the performance of EC2 instances and provides metrics, logs, and alarms.
    • Helps in making informed decisions about resource allocation.
  11. Placement Groups:
    • Controls the placement of instances within the AWS infrastructure.
    • Can be used to achieve low-latency and high-throughput communication between instances in the same group.
  12. Spot Instances:
    • Enables users to bid for unused EC2 capacity at potentially lower costs.
    • Ideal for workloads with flexible start and end times.

Configuration Example

Let's create a basic EC2 instance using the AWS Management Console:

  1. Login to AWS Console:

    • Navigate to the AWS Management Console.
  2. Launch an EC2 Instance:
    • Click on the "EC2" service.
    • Click "Launch Instance" to start the instance creation wizard.
  3. Choose an Amazon Machine Image (AMI):
    • Select an AMI based on your requirements (e.g., Amazon Linux 2).
  4. Choose an Instance Type:
    • Select the instance type based on your workload (e.g., t2.micro for a free-tier eligible instance).
  5. Configure Instance Details:
    • Set the number of instances, network settings, and other configurations.
    • Optionally, configure advanced settings like user data or IAM roles.
  6. Add Storage:
    • Configure the storage settings for the instance, such as root volume size and additional volumes if needed.
  7. Add Tags:
    • Add key-value tags to the instance for better organization and management.
  8. Configure Security Group:
    • Create or select a security group to control inbound and outbound traffic.
  9. Review and Launch:
    • Review your configuration and click "Launch."
  10. Key Pair:
    • Choose an existing key pair or create a new one for secure instance access.
  11. Access the Instance:
    • Once the instance is running, use the chosen key pair to connect via SSH (for Linux) or RDP (for Windows).