Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 5: Amazon EC2 (Elastic Compute Cloud)

AWS Cloud

Common Mistakes I See Students Make

Friends, this list comes from my classes – these mistakes happen in every new batch. Read it once and keep it in mind; it will save you time.

  • Selecting the wrong region (e.g. N. Virginia) and then "losing" the instance. The EC2 instances view is scoped to the selected account, Region, permissions and current filters. Confirm the exact instance ID before launching another.
  • SSH source set to My IP, then changing Wi-Fi/mobile hotspot. A changed public source can cause a timeout on that direct SSH path. Confirm the current endpoint, authorized network path and exact allowed source before requesting the narrow change. A private or managed path has different prerequisites.
  • Wrong username: A guest may reject authentication when the selected username or key does not match its current settings. Verify the account documented for the actual AMI and configured login.
  • Private key is missing or readable by unrelated users. Check the exact approved file and its platform-specific permissions before connecting.
  • Typing https:// for a server that only has HTTP and thinking the server is down.
  • Terminating when they meant to stop. Termination is permanent for that instance. Inspect each EBS volume retention preference and the approved recovery plan before a termination.
  • Leaving lab-owned resources allocated after the exercise. Check running instances, retained EBS and allocated public addresses independently, then verify the authorized cleanup plan.

Extended notes for this AWS lesson

Why students get stuck here

AWS pages look simple until three things collide: the service setting, the VPC/security group, and the app configuration. The expansions below separate those layers with real stacks and sample commands.

Always check three layersAWS servicesettingNetworkSG / NACL / DNSApp configendpoint / driver
Most "it does not connect" tickets miss one of these three.

The same pattern in app stacks

Whether the data store is RDS MySQL, PostgreSQL, or another engine, apps read an endpoint + user + password from the environment.

Java / Spring Boot

spring.datasource.url=jdbc:mysql://ENDPOINT:3306/db with password from Secrets Manager / env.

Python / Django / Flask

HOST from env; never commit settings with real hosts.

Node.js

mysql2/pg clients with process.env.DB_HOST.

.NET

ConnectionStrings via env or Parameter Store.

PHP / Laravel

DB_HOST in .env, not in Git.

Go

database/sql with env-based DSN.

Indian company (sample)

Suppose we are a junior cloud engineer at Swiggy or Razorpay-style infrastructure. A new microservice cannot reach RDS. You check: 1) SG on RDS allows the app SG on 3306/5432. 2) App is in a private subnet with a route to the DB subnet. 3) The secret in Secrets Manager matches the rotated password. 4) You connect with the mysql/psql client from the app host before blaming the ORM.

Global practice

AWS Well-Architected Security and Reliability pillars: scope security groups to the intended callers, select database availability and backup settings based on recovery requirements, and keep internal data paths private.

Everyday analogy

A warehouse (RDS) should not open onto the street. Delivery bikes (app servers) enter through a staff gate (security group) with a badge (password/IAM auth).

Engines and ports

MySQL / MariaDB on RDS

Port 3306. Users and grants like self-managed MySQL.

PostgreSQL on RDS

Port 5432. Prefer scram auth.

SQL Server on RDS

Port 1433. Common with .NET shops.

Amazon Aurora

MySQL or PostgreSQL compatible; learn the endpoint types (cluster vs reader).

Load balancers in one breath

ALB is for HTTP/HTTPS apps (Spring, Node, Django, .NET). NLB handles transport-layer traffic such as TCP or UDP on supported listeners. GWLB helps deploy virtual network appliances. Classic Load Balancer is the previous generation. Choose the frontend and backend encryption design for the workload and use a suitable certificate for every TLS listener.

Common EC2 and Linux mistakes (expanded)

  1. Plan an approved recovery path before losing access. Systems Manager Session Manager is an option when the instance, role, agent, connectivity and user permissions meet its prerequisites.
  2. Editing a training server without a recovery plan → identify needed application configuration, data and rebuild instructions, then verify the approved restore process. An AMI and bootstrap script have different roles.
  3. Opening 0.0.0.0/0 on SSH → restrict to your IP or VPN.
  4. Forgetting Elastic IP / DNS when testing restarts.
  5. Growing an EBS volume without checking its partition and filesystem. Inspect the actual partition layout and filesystem type before following the matching expansion procedure.

Common mistakes

  • Publicly accessible RDS "for a quick test" left open.
  • Mixing Classic LB advice with ALB listener rules.
  • Hard-coding IPs instead of DNS names for RDS endpoints.
  • Taking snapshots but never testing restore.

Worksheet

  1. Draw your VPC boxes: public subnet, private subnet, RDS subnet.
  2. Write the SG rules in a table.
  3. In an approved lab, verify the expected database connection from the intended application host and record which layer returned the result.
  4. Write the restore steps for a sample snapshot and state how you would verify a successful restore in a disposable environment.

Recap

  • Service + network + app config.
  • Private databases.
  • Prefer ALB + ACM for web apps.
  • Practise restore, not only backup.

Separate the failed step from the last step you verified

Mauli Dairy's instructor says, “Find yesterday's worker, read its sample page and hand the lab to the next student.” One student cannot find the instance. Another finds a running instance but receives a connection timeout. A third gets a response that has the wrong sample body. All three say “my EC2 doesn't work.” Each has evidence about a different step. Start by writing the exact operation and the first result that differed from the expected behavior.

A basic launch and connection path includes context, cloud resource state, guest readiness, connection path, authentication and useful application behavior. Context means account, Region and approved instance ID. If it is wrong, later checks might describe another resource. State describes the lifecycle. Guest readiness includes the running operating system, startup completion and required listener. An allowed path and login prove that you could enter under a particular role. The application still needs its own test.

For a class exercise, keep a compact table of the expected result, observed result and next permitted check. If a field is unknown, leave it marked unknown instead of changing settings at random. “Approved Region and instance ID confirmed. SSH reaches the trusted host but the requested account is rejected” narrows the issue to one access phase. “Instance unavailable in the console” may still be an account or Region selection error. Name the tool and time when someone else needs to repeat your observation.

This page uses synthetic examples, local exercises and read-only AWS inventory. A configuration mistake may need a change by the owner, but the first review does not authorize operating on an unrelated resource. Keep real identifiers and any secrets inside the approved support record. Use the expected instance ID or safe lab alias when comparing observations. Verify the intended user operation after the correction.

Find the instance in its actual account and Region

A trainee created mauli-worker in the instructor's Region and opens the console the next day in another Region. The instances table does not contain the worker. The empty result tells you about the selected view. It does not prove the worker is gone or that launching again will restore it. Check which account and role are active, the Region selector and any search or state filter. Then use the recorded instance ID rather than the friendly Name tag.

Look at difference between location and permission. A viewer without access may get an authorization message or see fewer records. A viewer in the wrong region might see an empty EC2 list but still be allowed to use the service under that region's rules. A recently terminated instance may appear briefly before leaving the list. Read the actual response and compare with the recorded state. A second launch is an additional resource, not evidence the original one no longer exists.

Regions also scope images, subnets, volumes and addresses. A friend may hand you an AMI ID from a different Region. The name and version might be available in your Region under a different identifier. Verify the trusted publisher, image architecture and actual regional ID. A network or address is not portable just because it has the same tag in two accounts. The reproducible part of a lab is the intended configuration, not every literal identifier copied across environments.

Consider a permitted read-only CLI comparison. The active profile, optional Region override and specified resource ID all help identify what the API request asks for. The AWS console can be using another role even if you opened it on the same laptop. Compare account aliases and role permissions through the approved access mechanism. If a profile setting is wrong, use the authorized training one, rather than editing or sourcing someone else's access keys.

Read the launch error before changing the image or hardware

Suppose the launch form fails after you choose an Arm-based type and an x86-only AMI. The machine cannot be created with that incompatible pair. Look at the image architecture and type specification. Match both to the application's supported platform. Choosing a bigger instance does not correct a different instruction set. An existing AMI's publisher and terms also matter. A similar-looking catalog title does not prove it is the approved image, or that a third-party license or subscription is permitted.

Now consider a different outcome. The image and type are compatible, but the selected location cannot currently allocate the requested capacity. The AWS error can distinguish supported capacity constraints from permission or quota issues. Read the actual message. An account quota problem may require its approved owner to review current usage and limits. An availability issue might need a compatible alternative placement or type permitted by the lab. These remedies are different from changing package commands in user data.

Inspect approved dependencies before retrying. The chosen subnet implies a zone. It must have the resources and free addresses the selected launch needs. Storage settings and encryption permissions can affect whether an eligible instance boots or launches. An attached instance profile requires the appropriate AWS permission to select under the account's rules. A learner should check the error and approved configuration rather than attaching wide administration permission to make the form submit.

Record which exact launch choices were accepted. Sometimes a browser shows a slow response even though the resource was created. Before submitting the form again, check for the known instance ID or the account's relevant activity. If more than one training resource was created, identify them individually and ask the authorized owner which should remain. Check all associated volumes and networking resources before finishing. A duplicate create can leave more billing than one misleading error screen suggests.

Verify startup work before calling a running instance ready

A guest reports as running, yet the learner's sample web page is absent. The EC2 state shows that its resource lifecycle reached the running phase. AWS reports additional status observations for supported checks. A separate guest and app test still needs to show the expected operation. Cloud resource health and application readiness are useful measurements at different layers.

Look for the expected startup milestone under the selected image. A cloud-init script can write a file or start a service. It may require package repository access, a compatible package, the right command for the distribution, or an application identity allowed to read its configuration. If a step fails, a later message should not imply all dependent steps worked. A well-designed training script produces a known small marker only after the relevant setup action completes. Read its outcome and the exact error under the approved scope.

A first-boot script is not a service supervisor. Suppose the app test worked because a student manually started a program in one remote shell. After reboot the instance starts correctly, but the program does not. The student should confirm the service startup configuration, not expect the original first-boot script to reinstall and start it every time. If course materials intend a temporary process only, mark that scope in the lab. A real app needs a deliberate startup and restart design.

Compare a request made to the guest's own loopback listener with a request from the approved client network. The local response can establish a specific file and program are working. It does not prove the intended subnet path or external listener. If the local proof fails, focus on the script, file and process. If it succeeds while an external request fails, inspect the intended route, association, listener binding and permitted source. Preserve those distinct results in the support ticket.

Diagnose SSH path, server identity and guest authentication independently

A learner starts from the approved office network, then changes to a mobile hotspot. A direct laboratory SSH rule may allow only the earlier observed client source. After switching networks, confirm the planned access method and current source under the owner’s rules. Also check the current instance endpoint, route and listener. A timeout can be consistent with a mismatched source, but it does not prove the security group is the cause. An old public bookmark, disconnected VPN or unavailable service might produce a similar observation.

A host key prompt requires a different check. Compare the displayed key to a trusted fingerprint for the same instance or endpoint. After a planned replacement a key can legitimately change. Verify the expected host, current address and new fingerprint with an approved trusted channel. Avoid accepting an unrecognized key automatically, erasing all stored keys or disabling the check to make a demo succeed. A successful network connection doesn't establish the identity of the responder.

If a verified host rejects public-key authentication, confirm the intended operating system username and the locally selected private key. Amazon Linux and official Ubuntu images commonly use different initial accounts. Guest settings can be changed after launch. An SSH client's key file warning can also indicate broad permissions or the wrong owner. Apply appropriate local protections only to the approved key file and platform. Correct file permissions do not cause a server to accept an unrelated key.

Recovery from a lost key is a controlled change. The private half of an AWS-generated key cannot be downloaded again. A configured managed session or another approved recovery method may allow an authorized administrator to repair access. Check its own prerequisites. Ask the owner to follow the account's procedure and remove replaced access if appropriate. Don't use public ports, an unrelated key or someone else's credentials to get around the failure.

Verify the protocol and expected response instead of assuming a website is down

Mauli's class demo has a local synthetic HTTP listener. A student pastes an HTTPS URL using the same port or types a public number into a browser. The error does not prove the operating system or HTTP handler failed. HTTPS adds encryption and endpoint identity checks under its configured transport. A port rule is only network policy. It cannot install a certificate or enable TLS. The correct test needs the designed hostname, protocol and listener.

Think about the intended caller. The previous lesson's loopback service is reachable from a command in the same guest. The same loopback number typed into the laptop identifies the laptop itself. Public browser tests use a different network path. An app target behind a public load balancer can be reachable through that frontend, even if a laptop cannot connect to the target's private address directly. Decide which flow the lab meant to prove before comparing outputs.

If the browser completes TLS for the intended host but shows the wrong page, identify which service responded. A hostname and path might select a different target or site configuration. A backend health check can succeed on a readiness path while the main operation fails for app or data reasons. A successful TCP connection is one observation. The intended certificate and sample application response need separate evidence. Use an approved representative request and inspect the relevant logs or target setting under the actual configuration.

Report the exact host, port, protocol, request path and useful response. When the lab is supposed to be private, a blocked public connection can be the correct result. Do not open a private worker's HTTP port to the internet just because a student wants a browser screenshot. Demonstrate the expected approved path. A sample response from the correct guest and endpoint is stronger evidence than a public probe against a resource outside the lesson.

Tell an attached volume from a mounted filesystem or a tested recovery copy

An EC2 console lists a newly attached EBS volume. A learner expects the app's filesystem to have more space automatically. The attachment makes a block device available to the guest. The operating system still needs to recognize the device and use the correct partition, filesystem and mount setup. When expanding an existing volume, the steps may also depend on the partitioning and filesystem type. Inspect the live environment before selecting platform commands.

On a Linux training account, a permitted read-only lsblk view can show block devices and their mount information. df -h describes filesystem space for mounted paths. They answer different questions. A device can appear in the first view and have no mounted filesystem in the second. If a cloud volume size increased, verify the exact device and mount where the app writes. Other attached disks can have similar sizes. Refer to AWS's procedure for mapping and extending the appropriate Linux volume.

Stop before commands that format, repartition or resize storage if you have not identified the intended volume and approved recovery plan. Applying instructions for an empty scratch drive to a live data disk can destroy records. A lost application file does not always require a filesystem change. Check which workload and identity wrote it and whether the chosen volume has the expected version. A preserved disk can contain incorrect data.

Practice reading a hypothetical inventory. The EBS root is configured to delete on termination, the second volume is retained, and a snapshot belongs to a development recovery test. That configuration can leave the data volume and its charges after the instance ends. The snapshot does not establish that today's data can be restored. Verify whether it contains the expected point in time and can be used under the approved identity. A useful recovery test restores a permitted sample record and proves the intended operation.

Choose a reversible pause rather than an unintended removal

The instructor says to be ready to resume the same demo tomorrow. That usually requires keeping the instance and its durable state. In an approved ordinary stop of an EBS-backed worker, the resource remains in a stopped state and can be started again. The retained EBS data can survive, but process memory and temporary instance store are different. If the worker had an auto-assigned public IPv4, the next start may need a different direct public connection value. Record the intended access path before interrupting the session.

Termination permanently ends the instance. A learner cannot choose Start afterward to recover the same instance ID. The root and data volumes follow their own deletion flags. Separately retained data and snapshots may be used in a new instance or approved recovery process, depending on configuration. If a request concerns removal, confirm which named resource and attachments are in scope and how the owner would recover required data. If a request concerns a pause, do not select an irreversible action to see what happens.

Termination protection helps block covered actions under AWS's documented behavior. Some lifecycle paths, such as management by Auto Scaling or other policies, work differently. A protection choice is not sufficient verification that data is protected. Watch the actual configuration and managing service. An account owner can design a stronger combination of limited permissions, backup, automation and an approved review step. This chapter's read-only lesson can compare the flags without submitting a real termination.

Review what changed after a reversible action using both cloud and guest records. A new boot cycle and usable private probe may coexist with a failed old public bookmark. Separate these findings. If the measured error is a stale endpoint, confirm the current association and DNS from the intended client. If the script did not start, check the actual guest service. Terminate-to-retry is not a useful default for uncertainty about those steps.

Find the resources that keep their own allocation after class

Mauli closes the browser and stops the class instance. The next bill still includes a retained EBS volume or an allocated public address. That does not necessarily mean the compute kept running. A bill is made of several resource categories, and some are governed by allocation time. List the exact approved instance, disk, snapshot and address records. Compare the state and recorded lifecycle for each.

An idle EIP can remain allocated when there is no associated direct EC2 instance. A target listing can also omit a direct instance ID for an address used by another AWS resource. Check the association or service owner before inferring it is available to remove. A backup snapshot can be part of the intended teaching handoff. A NAT gateway or frontend can support someone else's lab. Resolve ownership and actual dependencies instead of deleting any record named unused by a guess.

Build an inventory worksheet with columns for resource, owner, reason, expected end time, current status and permitted cleanup decision. The lab's created instance might be removable. A shared training network should remain. A retained snapshot may need a course retention date. A held address should be removed only when its approved purpose ends. Verify the individual outcome by resource identifier, and review an appropriate billing category later under the account's policy.

Use the current Free Tier or credit rules for the actual AWS account. Eligibility conditions can vary with date and plan. A small instance label does not set the billing treatment of its disk, public IPv4 or dependent services. If a learner is unsure, use a read-only or local worksheet instead. Managed budget alerts can help the account owner review usage and forecast. A notification does not shut down the lab or prove everything else was correctly disposed of.

Tell a cloud API access failure from a guest or workload access failure

Mauli's instructor can list EC2 resources but cannot start a managed session. A permitted application process can reach its training S3 bucket while the human operator can only read its own guest files. These combinations are valid. Each operation uses its own identity and permissions. The first error you see should name the actor and operation. “AWS access is broken” makes it difficult to distinguish the permissions that apply.

For an AWS API permission error, identify which authorized profile or console role sent the request, the exact resource it referenced and the account's policy. For guest access, identify the selected management method and its prerequisites. For an application call, find the workload role actually used and the relevant AWS service or data permissions. A network route still needs to exist to the chosen endpoint. Authentication and path are separate. An access denial returned by a service gives evidence of a reached responder, while a timeout implies the expected response did not arrive.

A common bad workaround is placing a long-lived admin key in instance user data because the app's permissions were insufficient. That mixes ownership and exposes the credential to places it should not be. Use the approved workload identity and resource policies, and inspect the intended permissions. A proper training app can retrieve the one synthetic object it needs. It can do that while the human observer has only console read permission. Good separation makes the next error simpler to diagnose.

Record the expected identity and behavior before an approved change. Test with the actual actor under the intended environment. Do not use your own more privileged terminal to declare success for the app. If the app can now read its test object but still shows an older order, inspect its selected data and logic. Completing the permission check is useful without being the endpoint of every service test.

Check placement before trying to attach storage or use an address

An instructor restores a training worker in Zone B and selects the data disk from yesterday's machine in Zone A. Both resources appear in the same Region. The disk still cannot be attached directly to that worker because an EBS volume attaches to an instance in the same Availability Zone. The learner did not lose the volume. Its placement is incompatible with the requested attachment. Check the instance's subnet zone and the volume's zone before selecting an operation.

Decide what the recovery exercise actually needs. If the data must move to Zone B and an approved snapshot exists, plan an appropriate volume restore in the intended zone under the relevant encryption and permissions. Verify the restore identity, data point and app compatibility before switching a real service. If the exercise simply needs a sample filesystem view, use the prepared training disk or the supplied worksheet. Moving a live volume by a guessed attachment can put another service's data at risk. A regional image and a zonal EBS volume have different placement requirements.

A public address has its own placement rule. An Elastic IP can be allocated in a particular Region and network border group. A target resource may be incompatible even though the two console screens show the same broad Region. Review the exact resource, service and border group before assigning it. An ordinary private IP also needs to belong to the network interface's intended subnet. This is why a successful restoration of compute settings does not automatically recreate the old network design.

Make a small placement table. Enter Region beside the AMI and VPC, zone beside each instance subnet and EBS volume, and network border group beside any EIP exercise. Then mark what you would inspect for a recovery operation that uses a new zone. Correct answers recognize the appropriate placement boundaries and name the storage and application checks that confirm a usable restore. An error message about mismatched zones cannot be repaired by granting a wider permission.

Read low utilization and high cost as two observations to investigate

Mauli's report shows low CPU and a larger-than-expected charge. One student concludes the chart is wrong because the bill clearly shows usage. The CPU chart describes a resource's processor activity during the selected period. Some cloud usage is charged for time and allocation rather than how hard the CPU works. Storage can remain, a gateway can carry data, and a test address can stay allocated. An idle instance can also still be in a running billable state.

Compare the actual time and scope before deciding on a correction. Check whether the chart shows the same instance ID and time window as the cost study. Cost data may group by service and update at a different cadence. The account can use tagging or billing views to find related resources if configured. Identify running instances, held public addresses and approved volume retention separately. Then ask whether an application requires the unused headroom or an owner has forgotten to end an isolated lab.

Low CPU can also appear when the app is stuck waiting on a dependency or event loop. If the complaint is slow operation rather than cost, evaluate useful request rate, memory pressure and dependency response times. Do not resize or stop a shared machine simply because one metric is low. A useful proposal states whether the objective is lowering retained costs, satisfying capacity goals or resolving a delay. The same data point can fit all three and needs context.

Use the following sample. One training instance runs for 20 hours with very low CPU. A separate EIP remained allocated for 48 hours and a 10 GiB volume remains because its data must be verified before release. Write the expected meter unit for each. Running compute time, public address allocation time and provisioned storage measure different things. Then identify one responsible owner and one expected verification step per resource. The exercise needs the pricing and retention assumptions alongside the charts before anyone proposes a change.

Practice choosing the first check from a synthetic incident log

Use Python 3 or paper. The worksheet uses predefined observations for training. It does not diagnose a real target or access the network. The sample branches choose a narrow first question based on a known observation. Several real failures can have the same symptom, so the next check gives a possible route to evidence, not an automatic production change.

python3 - <<'PY'
first_checks = {
    "not in selected view": "confirm account, Region and instance ID",
    "boot milestone missing": "inspect approved guest startup output",
    "host key changed": "confirm expected host identity from a trusted source",
    "publickey refused": "verify guest username and permitted key",
    "filesystem not larger": "check the exact block device, partition and mount",
    "compute ended, address held": "identify the allocation owner and duration",
}
reports = [
    ("case A", "not in selected view"),
    ("case B", "boot milestone missing"),
    ("case C", "host key changed"),
    ("case D", "filesystem not larger"),
    ("case E", "compute ended, address held"),
]
for label, observation in reports:
    print(label + ": " + first_checks[observation])
PY

Expect one line for each report, matching the corresponding first check from the dictionary. Change Case C to publickey refused and explain the changed result before rerunning. The public-key rejection is a user authentication result. The host key mismatch concerns the identity of the server and needs verification before trusting it. Those two cases can occur at the same address and require different actions.

Now add a report for an unexpected public address. You can write a review instruction that verifies the actual association and approved architecture, before any authorized owner changes it. If your program raises a missing-key error, make sure the observation matches a defined phrase, or add the appropriate review row. This behavior is specific to the toy worksheet. A lesson's parser cannot tell whether live network settings are correct. The code creates no files or cloud resources.

Read one approved cloud record and a guest record without making repairs

Use only the class instance the owner allows you to inspect. In the EC2 console verify the active account, Region and exact instance ID. Record state and the intended current network association. Choose the relevant status observation and root volume mapping. If the instance is absent, record filters and permissions, then check the regional scope with the owner. This is a read-only inspection. You can do it using the sample observations below instead.

Given observationWhat a complete note should include
The instance is running and a known image is listed.Cloud identity and current state, still waiting for a guest or useful service proof.
The authorized guest session works and the specified EBS mapping exists.Correct host and identity, plus which filesystem and data point the app actually uses.
A local request returns expected text, but the direct public browser path is blocked.Local app operation confirmed. Determine whether the lab intended an external path or a deliberately private listener.
The old test EIP still appears but no instance ID is listed.Inspect current association, service ownership and approved retention rather than releasing it blindly.

If you have a permitted Linux guest session and the installed read-only tools, run the following checks. They show basic machine identity and storage views without changing mount or volume settings. Use them only after verifying that you are in the intended guest. A laptop shell can return valid but irrelevant results for its own environment.

hostname
id
cat /etc/os-release
lsblk -o NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT
df -h

Expect an operating system record for the chosen image and a block view separate from its mounted filesystem sizes. An attached but unmounted volume can appear in lsblk and be absent from df. Do not assume the name is the same as the console's requested device label across all instance types. Consult AWS's volume mapping procedure and approved owner before modifying storage. If the utilities differ on the image, capture what the documented equivalent reports or use the worksheet.

Finish with a short handoff: verified environment, success and failure observations, next approved owner and scope. End any training session without changing packages, storage or the account. The audit created no new resources. If a different lab provisioned a disposable resource, use its scoped cleanup plan rather than acting on shared rows in this inventory.

Practice writing a correction that matches the evidence

  1. A student cannot find an instance in the console and wants to create another. Write a scope checklist with account and Region, actual instance ID, search filters and permissions. Name the result you need before requesting another launch.

  2. The app no longer works after a reboot, but SSH reaches the same intended host and reports the right guest. The class only started a process manually last time. Explain which authorized guest observation and service configuration you would check, and what useful app response proves the correction.

  3. A learner says an EBS disk disappeared because it is absent from df. Write a correction using block attachment and mount state, and a read-only way to gather evidence. Explain why the exercise does not format a device to check it.

  4. A lab account includes an unassociated public address, a detached recovery volume and an old test instance. Identify which resource the class owns and which evidence determines the next safe action for each. Your report needs exact ownership, current state and expected retention rather than a demand for an empty list.

Interview questions and worked answers

What would you check first if a known EC2 instance is missing?

Verify the intended account, role, Region and recorded instance ID. Check console filters and actual access or lifecycle evidence before launching another instance. The console view can be wrong even while the original instance still exists.

Does a running instance prove its user data worked?

Running describes the EC2 lifecycle. Guest setup can still be incomplete or fail on a dependency. Check the applicable status information, expected startup output and a representative app operation before reporting readiness.

How do you distinguish a wrong SSH key from a path problem?

A verified SSH host can reject a specific public-key authentication attempt. Check the intended account, key and authorized settings then. A timeout may happen earlier because the exchange did not obtain the expected response. Check current address, path, port and relevant policy.

What is the difference between adding EBS capacity and adding filesystem space?

EBS capacity describes the attached block device. The partition and filesystem can still show the old size or not be mounted. Identify the exact device and mounted path and follow the documented procedure only in an approved change.

What can still incur charges after finishing a lab?

Retained EBS volumes, snapshots, allocated public IPv4s and related network or other resources can remain. Account eligibility and pricing terms affect individual charges. Verify what the class owns and intended to remove instead of assuming the instance state describes the whole environment.

Check which observation will narrow the fault next

  1. The console search in one Region shows no match for the instance. What is the next useful step? A. Check the current account, Region and known ID. B. Delete every untagged volume. C. Launch three replacement instances.

    Show answer

    A. A view can be empty when the context or filter is wrong. Reconcile the actual scoped record before assuming the resource no longer exists. A fresh launch adds another resource.

  2. The approved guest returns the training page from its own loopback; the laptop cannot open the same loopback URL. What explains the difference? A. Loopback identifies the computer issuing the request. B. Loopback always points to the AWS server. C. EBS has no filesystem.

    Show answer

    A. Each host has its own loopback. A local success in the guest proves the service there. A different approved outside or managed path needs its own design and test.

  3. An SSH client receives a host key mismatch. What should happen first? A. Verify the expected host key through the approved trusted record. B. Remove every known host entry. C. Accept the key because EC2 opened a port.

    Show answer

    A. Check identity before trusting the server. A planned replacement or wrong endpoint can produce a different key. A successful network connection does not authorize a new key.

  4. A disk shows a larger block device size, while its mounted filesystem still shows the old capacity. Which records differ? A. Account name and billing program. B. Block device and filesystem. C. VPC and Region.

    Show answer

    B. Filesystem space can depend on partition and filesystem expansion after increasing the block device. Confirm the correct device, mount, filesystem and approved change before altering storage.

  5. Which shows only part of the evidence after an instance was terminated? A. The correct instance status was recorded. B. Every retained lab allocation was verified. C. Owner confirmed the snapshot should remain.

    Show answer

    A. Instance state confirms one resource. EBS retention, allocated addresses and supporting services have separate lives. Verify the specific items the approved lab plan intended to keep or remove.

Revision cards

Instance context
Use the exact account, Region and instance ID. Friendly labels and filters can obscure which resource you see.
Launch diagnosis
Check the actual architecture, availability, quota and authorization outcome before retrying.
Three connection phases
Locate the network path, verify the host key, then evaluate guest authentication.
Storage evidence
Attachment, partition, filesystem, mount and tested recovery are different observations.
Lifecycle
A stop can preserve an EBS-backed instance. Termination ends the resource and applies device retention settings.
Independent costs
Inspect specific owned compute, network and storage allocations before approving cleanup.

References