INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Core lesson 6 of 18Topic: EC2 and EBS: compute and storage

What is Amazon EC2? Instances, AMIs and EBS explained for beginners

Amazon EC2 (Elastic Compute Cloud) provides computing capacity on AWS. This introduction uses a typical virtual-server instance to separate its AMI, instance type, EBS storage and network configuration. An instance in the running state is not, by itself, evidence of a working web application or protected data.

What you will learn

Distinguish an instance, AMI, instance type, EBS and networking, then identify the data and cost checks associated with starting, stopping and terminating an instance.

Prerequisite

Know the roles of an OS, process, file, IAM and VPC. This lesson does not connect to AWS, accept keys or credentials, or launch resources.

Separate the source image, compute, storage and network

EC2 resource relationships; arrows are not a traffic-path trace
EC2 resource relationships; arrows are not a traffic-path trace1: AMI — Launch from an AMI; the image is not the running process. — EC2 instance. 2: EC2 instance — This example is EBS-backed. Check retention and termination settings separately. — EBS volume. 3: EC2 instance — Configure networking; running state alone does not establish reachability. — VPC networking123AMIEC2 instanceEBS volumeVPC networkingEC2 resource relationships; arrows are not a traffic-path trace1: AMI — Launch from an AMI; the image is not the running process. — EC2 instance. 2: EC2 instance — This example is EBS-backed. Check retention and termination settings separately. — EBS volume. 3: EC2 instance — Configure networking; running state alone does not establish reachability. — VPC networking123AMIEC2 instanceEBS volumeVPC networking
  1. AMI → EC2 instanceLaunch from an AMI; the image is not the running process.
  2. EC2 instance → EBS volumeThis example is EBS-backed. Check retention and termination settings separately.
  3. EC2 instance → VPC networkingConfigure networking; running state alone does not establish reachability.
AMI
The source image containing an OS and applicable software.
EC2 instance
Runs processing with the resources of the selected instance type.
EBS volume
Stores OS or application data as a separately managed resource.
VPC networking
Review subnet, network interface and security-group conditions.
Distinguish the decisions behind the terms
TermWhat it representsWhat it does not establish
InstanceA computing resourceApplication health
AMI (Amazon Machine Image)The source OS/software imageThat the launched system remains up to date
Instance typeA compute, memory and related resource configurationWhether it meets the application’s performance requirements
EBSAttached block storageTermination retention or recoverability of required data
Security groupTraffic permissions on associated interfacesAn OS listener or application authorization

Before choosing EC2, separate compute, files, database and networking

Consider an internal app that registers PDFs and lets people find documents by team or title. This example runs the app on EC2 and separates file storage, the database for document records, and network configuration.

Four service roles in a document-management app
Solid arrow: application request
Store or retrieve PDFs; query document records.
Dashed line: network configuration
The network-configuration relationship between VPC and EC2.
Four service roles in a document-management appSolid arrow: application request: Store or retrieve PDFs; query document records.. Dashed line: network configuration: The network-configuration relationship between VPC and EC2.. 1: App: EC2 — The app stores or retrieves the PDF files. — PDFs: S3. 2: App: EC2 — The app queries document records in the database. — Records: RDS. 3: Network: VPC — The VPC defines the EC2-side network configuration. — App: EC2123App: EC2PDFs: S3Records: RDSNetwork: VPCFour service roles in a document-management appSolid arrow: application request: Store or retrieve PDFs; query document records.. Dashed line: network configuration: The network-configuration relationship between VPC and EC2.. 1: App: EC2 — The app stores or retrieves the PDF files. — PDFs: S3. 2: App: EC2 — The app queries document records in the database. — Records: RDS. 3: Network: VPC — The VPC defines the EC2-side network configuration. — App: EC2123App: EC2PDFs: S3Records: RDSNetwork: VPC
  1. Request target: App: EC2 → PDFs: S3The app stores or retrieves the PDF files.
  2. Request target: App: EC2 → Records: RDSThe app queries document records in the database.
  3. Network configuration: Network: VPC — App: EC2The VPC defines the EC2-side network configuration.
App: EC2
In this example, a document-management app on EC2 processes PDF registration and document-record queries.
PDFs: S3
Store each PDF as an object.
Records: RDS
Use relational tables for document IDs, teams and titles in this example.
Network: VPC
Configure the network, routes and traffic conditions for resources.

The preceding EC2 example uses EBS for OS and application storage. This document-management example keeps its PDFs in S3 and its document records in RDS. Review connectivity, access and retention for each.

App execution candidates: compare control and programming models
Example candidateWhy consider it?Customer decisions remain
Typical EC2 virtual server (VM)You want to manage the guest OS and application processes.OS/app updates, capacity, data and recovery.
Containers on ECS with FargatePackage the app in containers while AWS manages host infrastructure.Images, sizing, networking, access and app updates.
Lambda Event FunctionsRun prepared code (a function) in response to an event, such as a file upload, or an API call.Function code/libraries, execution conditions, retries and durable storage.

A container packages an app for execution. Serverless describes infrastructure management; Fargate provides serverless compute for running containers. Managed describes work delegated to a service. RDS provides a managed database rather than a general-purpose host for the web app. This table produces a shortlist. Check execution time, required features, load, related resources and operations under matching requirements. A model name does not prove lowest cost, best performance or security. Review other Lambda primitives or ECS capacity options under their own conditions.

Choose an option to see the result and explanation.

A document-management app must search by team. It needs PDF files, document IDs/teams/titles, application processing and connectivity. Which approach organizes the service candidates appropriately?
Read the answer and reason

Answer: Choose app execution, PDF storage, a queryable database and connectivity separately. · Consider EC2 or another compute option for the app, S3 for PDFs, RDS for relational document records, and VPC for networking. Evaluate containers or Lambda separately against the app's requirements.

Continue with the role you need

Establish purpose and ownership before launch

  1. Define the workload, users, required data and end condition.
  2. Review the Region, AZ, AMI and instance-type requirements.
  3. Choose storage and establish retention, deletion and recovery needs.
  4. Design VPC/subnet/SG settings and guest-OS/application management.
  5. Review costs, permissions, maintenance ownership and cleanup before an authorized operator proceeds.

Check lifecycle state separately from stored data

Reading a typical EBS-backed instance lifecycle
State/actionMeaningRelated checks
RunningThe instance is runningOS, listener, app, access and ongoing charges
Normal stopStop an instance that can later be startedRetained EBS costs and loss of RAM/instance-store data
RebootRestart the operating systemDo not treat it as equivalent to stop/start
TerminatePermanently delete the instanceEach volume’s DeleteOnTermination, required data and retained resources

Data in EBS, instance store and RAM has different lifecycle behavior. A terminated instance cannot be started again. Even when a volume is retained, establish whether all required application data was actually saved there.

Worked example: the instance runs but the report does not open

Do not turn a state label into end-to-end success
Established factNext area to investigate
The instance is runningDestination address/name, routes and network controls
Relevant network conditions are satisfiedWhether the OS/application listens on the expected endpoint
The application process runsData location, OS permissions and application behavior
An S3 read is deniedCaller, action, resource and applicable permissions/controls

Choose an option to see the result and explanation.

EC2 reports running. Can you report that the web application is healthy?
Read the answer and reason

Answer: No: check connectivity, OS and application behavior · Running is an instance state. Establish the user-facing outcome by checking networking, application behavior, data and access conditions.

Include storage, communication and cleanup in the cost picture

EC2 compute costs depend on factors such as instance type, Region, purchasing option and runtime. Review EBS, snapshots, IP addresses, transfer and associated services separately. Stopping does not make the whole account free, and termination does not remove every resource.

  1. Explain the distinct roles of the instance, EBS and AMI.
  2. List what running state leaves unverified.
  3. Locate required data and review stop/termination behavior.
  4. Review complete costs and retained resources across used Regions.

Check, then explain in your own words

  1. Explain what is launched from an AMI and where processing runs.
  2. Separate storage, networking and access from instance state.
  3. Identify data and cost checks for stopping and termination.
Check your understanding: Is having an AMI the same as having a running application?

No. An AMI is a source image, not a running instance or process.

After launch, establish the OS/application state, connectivity, data and access. Source-image information is not evidence of current application behavior.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.