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

Chapter 5: Amazon EC2 (Elastic Compute Cloud)

AWS Cloud

5.3 How to launch an EC2 instance (console, step by step)

Come on, let's do the actual launch now! Open the console and do every step along with me – you cannot learn EC2 just by reading. Today we launch the first server for Mauli Dairy's website, web-server-1.

Before you start: sign in to the approved training account and select the allowed Region, such as Mumbai (ap-south-1) when the lab uses it. The legacy direct-browser options below apply to an authorized disposable public test. The private walkthrough later uses a separate management path and loopback verification.

Step 1 — Open EC2. Search "EC2" in the top search bar → EC2 Dashboard → Launch instance.

Step 2 — Name and tags. Name: web-server-1. (This creates a tag Name=web-server-1.)

Step 3 — Choose an AMI. Under Application and OS Images choose one of:

  • Amazon Linux 2023 AMI for the lab — user ec2-user. Check that the selected AMI and instance type are available under your plan.
  • Ubuntu Server 24.04 LTS (or 22.04 LTS) — user ubuntu
  • CentOS Stream 9 — search Browse more AMIs → AWS Marketplace / Community AMIs for the official "CentOS Stream 9" image — user ec2-user (older CentOS images used centos)

Keep architecture 64-bit (x86) unless you chose a Graviton type.

Step 4 — Instance type. Choose a small instance type the console shows as eligible under your account and Region. For example, it may offer t3.micro. AWS applies different Free Tier rules based on account creation date, so check your plan, credits or remaining allowance before launch.

Step 5 — Key pair (login). Click Create new key pair → name mykey → type RSA or ED25519 → format .pem (for OpenSSH on Linux/Mac/Windows 10+) or .ppk (for PuTTY) → Create. The file downloads only once — keep it safe.

Pay attention: this .pem file is the key to your server. As soon as it downloads, put it in a safe folder – if it lies in Downloads and gets deleted, AWS cannot give it back.

Step 6 — Network settings. Click Edit:

  • VPC and subnet: select the approved training network. Use a subnet with the required internet gateway route for the direct public example.
  • Auto-assign public IPv4: Enable only if the approved direct IPv4 exercise requires it. Leave it disabled for the private walkthrough.
  • Firewall (security groups): Create security group, name web-sg, only if your instructor expects a new lab group. Apply the relevant rules for the approved direct path:
Type Protocol Port Source Why
SSH TCP 22 My IP (e.g. 192.0.2.25/32) Restricts network source. Login also needs the expected authentication.
HTTP TCP 80 Approved training client CIDR Website
HTTPS TCP 443 Approved training client CIDR Use only when the approved exercise configures an HTTPS listener and certificate. The shown HTTP-only script does not use this rule.

The demonstration page uses the approved training source and only the actual listener port. Open a direct SSH path only if the lab needs it, and limit it to the approved network source and login identity. Use the separate TLS configuration before expecting HTTPS.

Step 7 — Configure storage. Use the root volume included with the lab AMI. If it offers an 8 GiB gp3 root volume, that is sufficient for the simple page. Before increasing it, check your storage allowance and whether the volume will be deleted on termination.

Step 8 — Advanced details (optional). For the optional direct-browser example only, use this user data on an approved disposable Amazon Linux 2023 instance with authorized package repository access. It installs and starts a synthetic HTTP site. The private loopback exercise below uses a different script:

#!/bin/bash
set -eu
dnf install -y nginx
printf '%s\n' '<h1>Mauli training HTTP response</h1>' > /usr/share/nginx/html/index.html
systemctl enable --now nginx

With the supported Linux cloud-init setup, the user-data script runs as root during initial setup. Do not add passwords or keys to it. An authorized operator who runs the installation or service commands manually needs the appropriate privileges, such as sudo dnf install -y nginx and sudo systemctl enable --now nginx.

Step 9 — Launch. Review the Summary panel → Launch instance → View all instances. Wait until Instance state = Running, then inspect the applicable EC2 status checks. Record the public IPv4 only for the approved direct-public path. Check the guest startup and expected application response separately.

Step 10 — Test. If your approved direct-public lab used the HTTP user data, open its actual training URL http://<PUBLIC_IP> from the permitted client and expect the synthetic training response. For the private workflow, use the loopback test in the later section.

The browser shows a timeout?

For the direct HTTP example, verify the expected public IPv4, the effective route to the internet gateway and permissions for the actual training source. Check the guest listener, startup results and requested protocol separately. HTTPS needs its own listener and certificate setup.

Ravindra Bagale's Tip

Before pressing Launch instance, check the Region, intended subnet, IPv4 association and the relevant security rules in the Summary. A direct public IPv4 path needs a public association. A private instance can use a different approved management and application path.

Lab

Use the approved training account and a compatible Linux image and type. Choose the private guest exercise below or the optional direct HTTP exercise if your instructor permits it. Inspect the applicable EC2 checks, then verify the expected sample response through the chosen path and record any lab-owned resources left to clean up.

Got it? AMI + instance type + key pair + security group + storage – these are the five pillars of a launch. Now let's move on to logging in to the server.

Decide what a successful lab launch will let you observe

Mauli Dairy needs a disposable Linux worker to check how an EC2 instance boots. You will identify the launched resource, verify a short startup record and read a sample response from a service reachable only inside that lab machine. A local response proves that the program started and answered a local request. It does not expose the practice server to the internet. A separate section explains how the original direct-public web exercise uses different address, route and access choices if the training environment is designed for it.

Before opening the launch form, write down your approved account and Region, chosen network and access mechanism, and whether you can launch and remove resources there. Confirm the account's resource and budget rules, Free Tier or credits if applicable, and what the instance and associated resources can cost. AWS Free Tier rules differ by account creation date and plan. The console's eligibility labels are one cue. Review the current terms and that account's billing conditions for the exact resources you plan to use.

The short local-response lab needs an isolated AWS sandbox, an approved boot image with cloud-init and Python 3 available, and management access to the guest. The walkthrough uses an existing instructor-provided private training subnet and Systems Manager Session Manager path as one example. This assumes the guest agent, instance role, network route to required service endpoints and your session permissions are already set up. If your lab owner instead provides an approved SSH path, use that configuration. An account with neither access path can use the paper exercise and example inventory.

Set your completion conditions. An ordinary EC2 instance in the expected account will report its ID and selected launch values. The guest should start and write the expected training file. The loopback response should return the expected status and text. You must be able to identify and dispose of or retain each lab-owned resource under the plan. Those steps distinguish cloud provisioning, guest readiness and finished cleanup. Decide who approves any change to a shared network before opening the form.

Select the account, Region and launch record before creating anything

In the AWS Management Console, first check the displayed account and role. Use the intended training access with appropriate permissions. Then choose the Region the exercise authorizes. An AWS Region contains isolated Availability Zones, and the subnet selected later places the new instance in one zone. An image or role name may be familiar while the actual VPC and subnet belong to another environment. Verify scope before acting. A learner should not run this exercise in a customer account or a shared production subnet.

Open EC2 and select the launch action. The labels in the AWS console can change, but the main choices are recognizable: tags, application and OS image, instance type, login configuration, network settings, storage and advanced settings. In the Name section use a distinctive training value, such as mauli-training-web-1 if that name is available under your class convention. A name is usually a tag. It can help locate the resource, but an existing instance with the same name is not necessarily the one you intend to edit or remove. Record the instance ID after the request is accepted.

Use the training account's permitted tags for purpose, environment and owner. They can help an instructor find leftover resources and distribute charges where the account has the relevant billing setup. Keep credentials, keys and real student information out of names and tags. For a classroom handoff a safe resource alias can stand in for the actual ID. Store real deployment identifiers only where the account owner permits.

Before proceeding, write the intended choices beside the form rather than filling it by memory. The plan should identify the role of the instance, expected AMI publisher and architecture, type, subnet, permitted management access, data retention and predicted billable components. If an option does not match the plan, inspect the actual dependency. An omitted permission or unsupported zone is easier to resolve before an instance is running and incurring charges.

Choose a supported image and type as a compatible pair

An Amazon Machine Image provides the starting operating system and storage mapping. Choose a known publisher and version that your course supports. A current Amazon Linux 2023 image is one example. Ubuntu is another, with its own expected login and package commands. Check the publisher and image documentation when you use a community or third-party selection. A look-alike name does not certify an image, nor does a popular article prove a copied image ID exists in your Region.

Check which architecture the image uses. An x86_64 image needs a compatible type. An arm64 image can fit a supported Graviton type and needs an Arm-compatible application and dependencies. Selecting a type with the memory you want does not resolve an architecture mismatch. Record the actual image ID in your launch summary and read the documented startup and login behavior for that image.

Next select a permitted type that fits the small learning goal. A worksheet might use a small general-purpose instance. The actual choice depends on the example environment, currently offered capacity, account limits and measured requirements. Consider architecture, assigned resources, platform and price. For a basic local Linux response test there is no need to select high-memory or accelerated hardware. If the expected type is unavailable in the subnet's zone, check the approved alternatives and quotas rather than moving into another account or enabling an unrelated feature.

Some instance types offer burstable CPU performance under documented credit modes. For this lab the actual work is small. A service with sustained CPU demand can behave differently or incur additional charges under some modes. Confirm the mode when it matters. The fact that a training app worked once at an idle system says little about capacity for real client load.

Take a screenshot only if the training account allows it, and avoid showing real IDs or connected resources in a shared assignment. Record the approved label or alias, image architecture, type and reason you chose it. This small note helps distinguish a later boot error from an invalid package or network path. Move on when the form shows a compatible selection with no unresolved price or configuration questions.

Choose one permissioned management path and its network prerequisites

Decide how the instructor expects you to interact with the guest. A Session Manager setup can let an authorized operator open a session without inbound SSH or a directly assigned public IPv4. The guest must register with Systems Manager under the supported agent and IAM setup, and it needs network access to the required services through the approved path. The person who opens the session also needs the relevant permissions. Absence of a direct public address is correct in that private design.

In this walkthrough choose the provided training VPC, the specified private subnet and the intended instance security group. Leave public IPv4 disabled when that is the lab design. Confirm that the subnet's effective route, security settings and any endpoints support the required management traffic. In the advanced settings select the approved instance profile if the training setup uses one. Changing a role or opening a port should be based on that account's plan, not done simply because a private service does not behave like a public connection.

If your training environment instead uses SSH, select the supported key or authorized login mechanism and approved source path. The login user is determined by the image and its configuration. For keys created by EC2, save the downloaded private key in the approved location as it is provided. The corresponding public key is the one the instance can be configured to accept. Do not email or paste the private part into the user data or course notes. A private SSH path may use VPN or another supported access mechanism, so direct public IP is only needed for a direct public design where that was explicitly chosen.

A security group defines permitted network traffic for associated resources. If the approved direct lab needs SSH, scope it to the authorized source and intended TCP port. A “My IP” entry reflects a client address observed by the console. It does not confirm who can authenticate, and can become stale if the learner changes networks. In the local response lab, no HTTP inbound rule is needed. The test service listens on loopback inside the guest. Public HTTP and HTTPS belong to a separate, deliberately configured design.

Stop before launch if you have no authorized path to the guest that the exercise requires. Ask the lab owner to confirm the intended setup or use the supplied paper observations. Enabling every inbound rule is not a test of which prerequisite was missing. State the particular identity, endpoint and route that need evidence. A repeatable configuration keeps the launch simple and lets you connect under the account's security design.

Choose the boot volume and record retention before adding startup instructions

In the storage pane inspect the device the selected image will use to boot. The launch form may propose an EBS root size and type suitable for that image. Record the expected size, whether encryption is enabled under the account and which key policy applies, and whether the volume is configured to delete on instance termination. The minimum size depends on the image and application. Increase it only for an identified need. Another attached volume or snapshot can be billed even when no app handles a request.

After selecting storage, look at the advanced settings relevant to this lab. The instance profile supplies approved workload permissions if selected. User data supplies the startup instructions. The instance metadata options govern access behavior for metadata. Use the account's expected settings and a compatible image and application. Where IMDSv2 is required, verify that software uses compatible access. Leave secret values out of all launch notes and startup inputs. The exercise does not need key or credential values in the guest file it creates.

The user data example below uses a cloud-init-supported Linux image and the simple shell tools already on the guest. It creates a single example page in a dedicated directory for the disposable worker. It does not install a web server, contact a package repository or listen on the network by itself. Add this only during the approved launch. A common cloud-init setup runs such EC2 user data as root during the first boot cycle. Behavior depends on the image and cloud-init configuration. Rebooting does not ordinarily re-run all first-boot instructions by itself.

#!/bin/bash
set -eu

install -d -m 0755 /var/lib/mauli-training
page=$(mktemp /var/lib/mauli-training/index.XXXXXX)
printf '%s\n' 'Mauli training worker is ready for the loopback test.' > "$page"
chmod 0644 "$page"
mv "$page" /var/lib/mauli-training/index.html
printf '%s\n' 'Created mauli-training readiness file.'

The first line chooses the interpreter. The shell options cause the script to exit for many unhandled errors and on an unset variable. The directory belongs to this disposable lab. The script writes a temporary file, sets the page's read permissions and moves it to the chosen filename. The final message confirms the script reached that line. It does not certify that the app can accept connections. Later you will deliberately start a loopback-only listener to check the serving step.

If your instructor supplies a prebuilt test instance without needing launch changes, use that provided exercise and skip user data. Compare the readiness record rather than writing over a different system's files. Record which configuration you selected and what it is expected to do before the first boot, then leave the full startup proof to a guest check.

Review the configuration and identify the exact instance you launched

Read the Summary section carefully. Confirm the count is one for this simple exercise. Recheck the account and Region, image and architecture, type, subnet and actual network access, expected storage retention and any assigned role. A small mismatch, such as an old default subnet or a missing role association, often explains a first-lab problem. If you decide to use allocated public addresses or paid related services, add them to the cost and cleanup worksheet before submitting.

Choose the launch action once. When the console reports the request was accepted, open the created resource and record its instance ID and expected time. A launch can spend time in pending before it becomes running. If the browser displays a delay, check the list for the created ID or its approved label before submitting another launch. Accidentally creating extra instances makes both troubleshooting and billing less clear.

When the instance is running, inspect the current status check details. Look at the check types that apply to that instance. For example, AWS reports system status, instance status and attached EBS observations under relevant supported conditions, and documents additional check types for some use cases. A fixed displayed total is not a durable verification method. Note which checks are still initializing or failing. A completed EC2 check still does not prove the sample file exists or that an application returns the right message.

Compare the launch result with your original form. The ID and placement should fit your training scope. The image and type should match the intended compatibility. A private learner instance should show the expected private IPv4 and no ordinary direct public IPv4 if none was planned. For the management path confirm that a relevant profile and network are present. Stop and investigate if your instance is unexpectedly public or has other settings that do not fit the approved lab. Use the owner's authorized change procedure.

Verify first boot and serve one request inside the lab guest

Use the approved Session Manager or SSH access to the same training instance you just recorded. Start by checking the guest hostname and current user under the expected access policy. The EC2 instance ID and the hostname are different identifiers. If the portal or lab provider gives you an approved way to confirm both, keep the observations side by side. Do not log into another machine just because the same Name tag appears in the console.

On the supported cloud-init image, inspect the initial setup status. On a Linux image that provides the standard timeout command, this pair keeps the wait bounded. A nonzero result can mean cloud-init is still running after the timeout or that it encountered an issue. Read the actual status and any training-specific output before assuming the user data succeeded.

hostname
whoami
timeout 120 cloud-init status --wait
ls -ld /var/lib/mauli-training
ls -l /var/lib/mauli-training/index.html
cat /var/lib/mauli-training/index.html

Expect the example page to contain Mauli training worker is ready for the loopback test. It should be readable by the intended guest user. The cloud-init status can report completion even if a particular expectation was not satisfied, so verify the file separately. If the folder is absent, inspect the authorized startup log or ask the lab owner to read it. On many cloud-init Linux images the output log is /var/log/cloud-init-output.log. Look for the script's actual final message and earlier errors. Do not share full boot logs outside the training environment.

Start a temporary HTTP listener in a guest terminal that stays open for the check. This command uses the selected directory only and binds to the guest's IPv4 loopback address. The chosen port is an example. If it is already in use by the lab, stop and confirm a different agreed scratch port or use another disposable environment. Leave the loopback binding in place.

python3 -m http.server 8080 --bind 127.0.0.1 --directory /var/lib/mauli-training

In a second approved session to the same guest, run the request below. The URL refers to that guest's own loopback interface. A curl command running on your laptop would refer to the laptop's loopback instead, even if you know the server's hostname.

curl --noproxy '*' -i --max-time 5 http://127.0.0.1:8080/index.html

Expect an HTTP success response, normally status 200 for the named file, with the training message. A 404 would mean a responder accepted the request but could not find the chosen path. A connection failure can mean the temporary listener is stopped, the command points at the wrong local port, or you sent it from another host's loopback. Compare the exact host, local listener, command and file before requesting any new network access.

Stop the temporary server with Control-C in the terminal where you started it. Repeating the local request should now fail to connect if that scratch port remains unused. The guest file can remain until you dispose of the one training volume or remove that known sample file under the account's lab policy. Do not delete a directory you have not verified as the lab's own input. Follow the resource cleanup section below for the instance and any cloud attachments.

Explain the differences if the owner approves a direct public demonstration

The original example opens a test page in a browser at the instance's public IPv4. That is a separate design from the private worker above. Use it only in a disposable training environment specifically configured for direct browser testing. A VPC subnet with the correct internet gateway route, an associated public IPv4 and a permitted external path must all be present. The guest needs a test listener that accepts traffic from the intended interface, while the local Python listener above deliberately only serves loopback.

Identify which destination the authorized test uses. Plain HTTP on the configured port can be enough for a synthetic practice page that carries no learner or customer credentials. Scope its source to the approved training group or client network when the exercise only needs that audience. HTTPS requires a listener with the intended TLS configuration and a certificate the client can verify for its hostname or supported IP identity. An inbound rule on TCP 443 does not install or configure TLS. Remove test-only rules when the training design calls for them to end.

When entering the intended URL, use the actual allocated endpoint from the training account and its configured protocol. Addresses in the documentation blocks are only diagram values. Do not switch between HTTP and HTTPS as the sole troubleshooting method. If the account does not approve the public design, use the private loopback proof from the main lab. A completed local test is valid evidence that the provisioning and guest steps worked even when the subnet correctly denies ordinary public connection.

For a more representative production design, a public app frontend might accept HTTPS and contact private app instances through distinct target connections. The owner decides how the certificate, listener, security rules and app data access are managed. The single-instance exercise only demonstrates one small path. An approved lesson environment should avoid using live customer records, service credentials or production DNS merely to check whether a learner's instance booted.

Use the observed failure to choose the next launch check

Observed resultPossible scope of the problemNext useful check
Launch request returns an authorization error.Account or role lacks a required permission for the chosen action or resource.Confirm training account, role and approved selections. Ask the lab owner which control applies.
Launch cannot allocate the selected type.Type availability, quotas or placement in the selected zone.Read the reported reason and compare documented, approved alternatives.
Instance reports running but the approved session is unavailable.Guest access path or initial readiness.Check status details, the chosen access mechanism's permissions and connectivity, and guest registration if relevant.
Guest is reachable but the sample file is missing.User data execution, supported tool or filesystem issue.Inspect the scoped startup evidence. Confirm the image and exact script settings.
The sample file exists but the HTTP response is unexpected.Wrong guest, scratch port or path. A listener or app may respond differently.Compare hostname, listener and URL. Use the response code and expected body to narrow the problem.

Use identifiers when checking a launch problem. A healthy resource with the same tag can make it look as though the new one is working. Match the recorded instance ID, launch time and region. A permission error does not mean the instance needs a public address. A resource allocation error does not mean the user data script should be changed. A visible listener that responds with a failure is different from a blocked connection. Write the actual evidence before choosing the next step.

In a production system the permissions and approval flow can differ from a classroom. Keep every trial in the environment approved for it. In a shared lab note who is responsible for the subnet, role and AMI before requesting changes. In this exercise the only intended write is to the disposable instance created for the lesson, and the listening process accepts local connections only. If the observed setup differs, review it with the owner before proceeding.

Record readiness at two different times

Suppose an approved launch completes just before class starts. At 09:04 the instance is running and its status checks are still initializing. At 09:06 the system and instance checks in the example show OK. At 09:08 the guest writes the sample page. When you try the local test at 09:09, the HTTP server displays the expected response. These are four observations from three layers. Keep their timestamps instead of replacing them with a statement that the launch “took five minutes.” One teammate needs to know how fast compute started, while the app owner needs to know how soon a representative operation worked.

If the training role already permits EC2 CLI reads, set the placeholders below and query the one allowed instance. This example selects three check fields for comparison. AWS documents other check types for supported workloads, so this query is a specific report and not a universal list. You can use the equivalent console status details when the CLI is not part of your training.

LAB_PROFILE='REPLACE_WITH_TRAINING_PROFILE'
LAB_REGION='REPLACE_WITH_TRAINING_REGION'
LAB_INSTANCE='REPLACE_WITH_TRAINING_INSTANCE_ID'

aws ec2 describe-instance-status \
  --profile "$LAB_PROFILE" --region "$LAB_REGION" \
  --instance-ids "$LAB_INSTANCE" --include-all-instances \
  --query 'InstanceStatuses[].{State:InstanceState.Name,System:SystemStatus.Status,Guest:InstanceStatus.Status,Storage:AttachedEbsStatus.Status}' \
  --output json

A matching status row might show the running state, OK for system and instance status, and an attached storage status when supported and reported. A missing optional value is not necessarily a failed check. Consult its documentation and compare what the console reports. An empty response or an error needs identification of the account, Region, exact ID and relevant permissions. Check the result against the time you actually made the guest request. The cloud query does not read the contents of the sample file.

Give the next operator two columns: what the cloud reported and what the authorized request returned. If they cannot reproduce your check, ask for the exact identifier and hostname, and verify that the process still runs. Be aware that stopping the temporary server is expected at cleanup. Your record should say when you stopped it so a later connection failure is easy to interpret.

Preserve the settings worth repeating after the first launch

When you create a second disposable worker later, compare the original launch input with the working state. If the first worker needed a correction made after opening the guest session, write it down with its reason. The next launch might otherwise repeat the early problem. For an approved long-running deployment, capture stable launch choices and startup instructions using the team's reviewed automation or EC2 launch template. Versioned templates let an owner select a known configuration and review changes while keeping older decisions available where appropriate. This lesson can document the inputs without creating a template.

Examples of repeatable inputs include the supported image, instance type, expected storage, approved networking and intended bootstrap. A particular instance ID or an ordinary dynamically assigned public IPv4 is an output, so do not copy it as an input for a new worker. The secret behind an approved role should not be embedded in a template. Keep environment-specific values and account permissions in the right place. An unused copied training subnet value can send a replacement into the wrong environment.

Give a future learner your safe reproduction checklist. They should independently confirm Region, inspect planned inputs before launching, verify the resource ID and relevant checks, then record the guest milestone and useful local response. Add a completion line for retained resources. If the class setup changes, update the record one decision at a time. Keeping expected outcomes alongside the values lets another learner adapt to a changed console label or image while still meeting the same exercise goal.

Rehearse the launch and cleanup decisions without allocating anything

This paper version needs the earlier worksheet, an instructor's example instance plan or the table below, and no AWS permissions. Read each row and compare it to a correct intended result. In the approved plan the region and IDs are examples. The instance is private, bootstraps a sample file and has approved session access. You will decide whether its launch is complete using evidence from two observations.

StageGiven example resultMeasure completion
Console after launchSelected instance ID, private app subnet, intended architecture, no direct public IPv4 and expected EBS mapping.Verify that this is the correct resource and matches approved settings.
Guest setupInstance running. Cloud-init output does not yet show the final sample-file message.Wait within the allowed window or read the specific startup outcome before testing the file.
Local testSame guest, temporary loopback listener, status 200 and the expected training body.Confirm the file was served through the intended guest path.
CleanupA retained test EBS volume and a shared security group still appear after the instance is terminated.Verify ownership. Only remove a known lab-owned resource when allowed. Leave the shared group in place.

Write what each row proves. In the second row the instance state shows the running phase and the lack of startup output suggests readiness is unproven. In the third row app readiness is demonstrated only locally for the test page. In the fourth row termination and retained volume presence are both true. These differences are why a good classroom answer uses several checks rather than one screenshot showing running.

Now swap one input. Pretend the intended AMI is Arm but the allowed type in the form is x86 only. Explain which choice must be revised before submission, and how to verify app compatibility. Then change the input to an unapproved shared subnet. Explain how to stop the plan and use the proper lab design. The exercise's outcome is a completed worksheet and no manually provisioned resources. Remove only your own scratch notes that you no longer need.

Verify the lab ended at the instance, disk, address and service layers

Finish the test process before closing the guest session. Record the expected marker and response in your worksheet. If the approved training instructions call for ending the resource, verify the account, Region, instance ID and ownership. A stop is reversible for supported configurations and commonly ends the running compute state. Termination ends the resource and can remove some associated storage according to its settings. Remove only the disposable resource you created and which the lab permits you to remove.

Check EBS volume retention and any independently created items. A volume can survive termination under its setting and remain billable. An Elastic IP may be a separate allocation. A load balancer or NAT gateway created for a separate demonstration may continue to exist even if it has no active instance. Key pair records, extra security groups, snapshots and DNS are different resource types with different cost and dependency implications. Follow the training scope and check owner and other consumers before removing anything.

If this lesson used a pre-existing class VPC, subnet, role or group, leave that shared infrastructure alone. Deleting a shared item to make a console screen look empty does not complete the lab. Check the actual instances and relevant test attachments you own. Use the designated billing or inventory view to confirm the account's controls for retained resources. Infrastructure inventory and billing can become visible on different schedules, so note which resource state you observed and when. No account action is required for a paper-only exercise.

Submit the launch checklist with expected evidence beside each choice

  1. Write the approved Region, image identity and architecture, chosen type, subnet, management access, expected volume size and retention setting. Beside each value explain the requirement it meets. Include where you would verify the same value after launch.

  2. Compare an intended private Session Manager launch with an approved direct SSH demonstration. For each one state client, identity, network dependencies and whether a direct public IPv4 is needed. Your answer should keep login permissions separate from access granted to an application role.

  3. If cloud-init reports an error before writing the file, list the observations that remain valid and the next approved check. Success includes reproducing the boot result without opening a public app port on a private-only worker.

  4. Submit an ownership list for a sample instance, EBS volume, public address and training subnet. Mark which are class-owned versus individually created, then state whether each is retained or removed under the exercise. Verify the expected outcome by resource ID or agreed safe alias.

Interview questions and worked answers

Why verify the console account and Region before launching?

Images, networking and instance availability depend on location and permissions. A familiar tag can exist in another environment. Matching the account, authorized scope and region helps ensure you provision the intended resource and later verify the correct record.

Why can an approved private instance be managed without its own public IPv4?

Management can use an approved private or managed access path, such as Session Manager when its prerequisites are met. The agent and intended permissions and network connectivity still need to work. The access design and instance's public address are separate decisions.

Does a cloud-init success marker prove the service accepts requests?

The marker proves the script wrote the observed file or reached the specific action that created it. A working service needs a listener and actual response from the intended client. This lab explicitly sets up a temporary loopback listener and verifies the response after the marker check.

How would you verify the instance was cleaned up?

Identify the exact lab-owned resource and expected state. Then check attached and retained EBS volumes, address allocations and other resources created for the exercise. Stopping or terminating compute answers one lifecycle question. The associated items can have separate state and ownership.

Why check the image and type together?

The image and installed app need a supported instruction set, operating system and boot configuration. The instance type defines compatible architecture and available resources. The selected Region also determines which image IDs and capacity options can be used.

Check the launch and verification order

  1. Which identifies the exact deployed instance most reliably? A. The instance ID, account and Region. B. An identical friendly name elsewhere. C. The number of terminal windows.

    Show answer

    A. Use the actual account and instance record. Friendly tags can be reused by different instances or environments. Capture the intended resource after launch and refer to that record for changes.

  2. The private lab uses Session Manager. Which setup supports its planned access? A. An unrestricted inbound SSH rule. B. The approved agent, role, endpoint path and user permissions. C. A public web listener.

    Show answer

    B. Session Manager needs the documented prerequisites for the managed instance and caller. The private design does not need direct internet SSH or the public web listener used in a separate exercise.

  3. What does the loopback URL test from the guest prove? A. The guest can answer the intended local request. B. Every internet client can reach it. C. The Region is free of charges.

    Show answer

    A. A response from the local listener proves that local service behavior for the tested address and path. It does not show a public route, TLS configuration, or account billing state.

  4. The shell script is supposed to create a page, but no page appears. What should you check? A. The startup record, actual script and file path. B. Only the public IPv4. C. The domain registration.

    Show answer

    A. Inspect the boot setup and its error state. A missing local file is not explained by the lack of a public address alone. Confirm the image and script ran as expected before testing the listener.

  5. Which can stay allocated after instance termination? A. A retained EBS volume or separate Elastic IP. B. That terminated process continuing to answer requests. C. Every volume irrespective of its configuration.

    Show answer

    A. Separate resources and configured retention matter. Verify their individual state and ownership. Termination ends the instance, while some volumes or allocated addresses can remain.

Revision cards

Preflight context
Confirm account, authorized Region, load and budget, then choose the intended image, type, subnet and access.
Private lab
Use the approved management path. Local loopback testing requires no public inbound application rule.
User data
Check image support, startup source, file permissions and the actual expected result. Keep secrets out of launch input.
Launch versus app health
Read the applicable EC2 checks and prove the intended application operation separately.
Scope of loopback
The current host serves its own loopback. Use the test URL from the correct guest.
Cleanup evidence
Verify instance state and separately identify owned volumes, addresses and services that can remain.

References