AWS re/Start Lab · Operations

Using AWS Systems Manager

Operate an EC2 instance entirely without SSH using four capabilities of AWS Systems Manager: Fleet Manager (inventory), Run Command (remote execution), Parameter Store (configuration), and Session Manager (auditable shell). All access is brokered by the SSM agent plus an IAM instance profile — no port 22, no key pairs, no bastion host.

Lab Summary

A single EC2 instance (i-02ee2bf02e6d075c8 in us-west-2) was managed end-to-end through SSM: software inventory was gathered through Fleet Manager, the Widget Manufacturing Dashboard web app was installed via Run Command, a feature flag was toggled through Parameter Store, and the instance shell was reached through Session Manager — never opening port 22.

Four capabilities, one instance

Fleet Manager + Run Command + Parameter Store + Session Manager covered the full lifecycle: inspect → install → configure → access.

SSH was never used

No PuTTY, no key pair download, no port 22 open. The IAM instance profile App-Role plus the SSM agent replaced the entire bastion / SSH workflow.

Lab Architecture

A single EC2 instance pre-configured as a Managed Instance. The SSM agent runs inside the OS and dials out to the SSM service; the instance profile authorizes that connection. The user interacts with SSM from the console — never directly with the instance.

Component Identifier Role in the lab
EC2 Managed Instance i-02ee2bf02e6d075c8 · ip-10-0-0-48 Target for every SSM operation. Pre-installed SSM agent.
IAM Instance Profile arn:aws:iam::370129130217:instance-profile/App-Role Grants the SSM agent permission to register and accept commands.
Region us-west-2 All resources scoped here. Derived dynamically from IMDS in Task 4.
Web app target Apache + PHP + AWS SDK + Widget Manufacturing Dashboard Installed by Run Command. Reads /dashboard/* from Parameter Store at request time.
Why this matters: The same pattern scales to fleets — replace "this one instance" with a tag selector and every action below applies to thousands of nodes without inbound network access.

Step-by-Step Walkthrough

One section per SSM capability. Trivial console navigation is collapsed into prose; each section ends with the evidence captured during the lab.

01

Fleet Manager — Inventory the Managed Instance

Inside Systems Manager → Node ManagementFleet Manager, opened the Account management dropdown and chose Set up inventory. Created an association named Inventory-Association targeting the Managed Instance manually. Defaults were left intact.

  • Inventory is set up as an SSM association, not a one-shot scan — it re-collects on a schedule, so the data stays fresh without manual refreshes.
  • The association immediately reported a banner "Setup inventory request succeeded" and the inventory began populating from the SSM agent's side.
  • Drilling into the Node ID and opening the Inventory tab exposed every inventory type (applications, network, services, etc.) — useful to validate software policy without touching the instance.
Takeaway: the inventory list is the proof that the agent + IAM pairing is wired correctly. If AWS:Application returns rows, every later capability will work.
02

Run Command — Install the Widget Manufacturing Dashboard

Under Node ManagementRun Command, picked the custom document Install Dashboard App (filtered by Owner = Owned by me). That document runs an install script that lays down Apache, PHP, the AWS SDK, and the dashboard files, then starts the web server. Targets were specified manually (Managed Instance) and the S3 output bucket option was cleared.

  • The lab guide highlights that the console form exposes the exact CLI under AWS command line interface command. That snippet (aws ssm send-command) is the same call you'd put in a script or CI pipeline — the GUI is just a wizard around it.
  • Right after submitting, the Command ID page showed In Progress; per the guide it converges to Success in 1–2 minutes. The captured screenshot is the In Progress moment — the dashboard rendering after is the real proof the script finished.
  • Targeting was manual here, but the same form accepts tag-based selection — that's how a single Run Command call hits an entire fleet.

After the command finished, the ServerIP value from the lab Credentials panel was opened in a browser. The dashboard rendered with two charts — output gauge and stage throughput bar — confirming that Apache, PHP, the SDK, and the app were all installed and the service was up.

03

Parameter Store — Toggle a feature flag without redeploying

Under Application ManagementParameter Store, created a parameter with the configuration below. No screenshot of the form — the dashboard's third chart is the proof that the value was picked up.

Field Value
Name /dashboard/show-beta-features
Description Display beta features
Tier Standard (default)
Type String (default)
Value True
  • The hierarchical name /dashboard/<option> is intentional — Parameter Store supports path queries (get-parameters-by-path), so the whole namespace is one fetch from the application.
  • The app polls Parameter Store on each request. No redeploy, no config file rewrite, no restart — flip the value and the next refresh sees it. That's the dark-features / feature-flag pattern in one of its simplest forms.
  • Refreshing the dashboard's browser tab showed a third chart appear: Shipping Throughput (Beta feature). Deleting the parameter would make it disappear again on the next refresh (optional step, not executed here — the apparition was proof enough).
Before / after: compare screenshot 03 (two charts) against 04 (three charts). The only thing that changed between them is a single key in Parameter Store.
04

Session Manager — Browser shell into the instance, no SSH

Under Node ManagementSession Manager, started a session against the Managed Instance. A browser tab opened with a working shell as sh-4.2$ — no keypair, no port 22, no bastion. The session ID and the instance ID are stamped at the top of the terminal banner, which is what CloudTrail correlates for audit.

  • Listed the application files installed by Run Command:
    ls /var/www/html
  • Derived the region from the Instance Metadata Service (IMDS) and ran a region-aware describe-instances:
    # Get region from IMDS
    AZ=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
    export AWS_DEFAULT_REGION=${AZ::-1}
    
    # List information about EC2 instances
    aws ec2 describe-instances
  • The ${AZ::-1} trim is the small clever bit — IMDS returns the AZ (us-west-2a); slicing off the trailing letter yields the region (us-west-2) without hardcoding it. The same script works in any region.
  • The describe-instances output confirmed identity from the inside: the instance profile is arn:aws:iam::370129130217:instance-profile/App-Role and the tag Name = Managed Instance matches everything seen in the console.
Misleading filename, deliberate lesson: the original screenshot was saved as ec2detailsfromSSH.png. It is not SSH — that's literally what this task teaches. Session Manager looks like SSH from the user's seat, but the connection is an outbound HTTPS tunnel brokered by the SSM agent. The file was renamed to 05-session-manager-describe-instances.png so the evidence matches the lesson.
IMDS observation: the JSON shows "MetadataOptions": { "HttpTokens": "optional" }. That means this lab instance still accepts IMDSv1 requests. Production hardening would set HttpTokens: required to force IMDSv2 session tokens and block SSRF-style metadata abuse. Worth noting because the IMDS endpoint 169.254.169.254 was used in the script above.

Capabilities Reference

Quick map of the four SSM capabilities exercised, what they replace, and the key prerequisite shared by all of them.

Capability What it does Replaces Evidence
Fleet Manager Periodically collects OS, package, network, and service inventory via an SSM association. SSH + rpm -qa / dpkg -l loops; agent-based CMDB tools. 456 apps listed under AWS:Application
Run Command Executes a pre-approved document on one or many instances; supports tag-based fleet selection. SSH + bash for-loops; Ansible ad-hoc against managed hosts. Command ID 5c8b7057-…59b → dashboard live
Parameter Store Hierarchical key/value store. Polled by the app at request time for feature flags & config. Config files baked into AMIs; environment variables requiring restart. Third dashboard chart appeared on refresh
Session Manager Browser- or CLI-based shell brokered by the SSM agent. Auditable through CloudTrail. SSH on port 22 + bastion hosts + key-pair rotation. Browser shell running aws ec2 describe-instances
Shared prerequisite: SSM agent running on the instance plus an IAM instance profile that includes AmazonSSMManagedInstanceCore. Without that pairing, none of the four capabilities can reach the instance.

Key Learnings

What Was Actually Learned

A Managed Instance is the union of SSM agent + IAM role with AmazonSSMManagedInstanceCore. Everything else in SSM is built on that.
Inventory is delivered as an SSM association, not a manual scan — the agent reports on a schedule.
Run Command's console form exposes the equivalent aws ssm send-command — the GUI is a wizard around the CLI, the CLI is what you put in pipelines.
Parameter Store with hierarchical names (/dashboard/*) is enough to ship a working feature-flag pattern without redeploying.
Session Manager replaces the SSH + bastion + key-pair stack with an HTTPS tunnel + IAM + CloudTrail. The shell looks identical from the user's seat.
IMDS at 169.254.169.254 is the canonical way to make scripts region-aware. HttpTokens: optional means the instance still accepts IMDSv1 — production should require IMDSv2.

Technical Conclusion

The SSH workflow established in earlier labs (PuTTY + .ppk key + port 22) is not the only way to operate an EC2 instance — and in many production environments it is the wrong way. AWS Systems Manager folds inspection, remote execution, configuration, and interactive access into a single agent-plus-IAM pattern. Once the instance profile is in place, the inbound network surface for management can drop to zero.

The lab also illustrates an honest operational pattern: the "In Progress" screenshot from Run Command isn't really the success signal — the rendered dashboard is. And the "misnamed SSH screenshot" from Task 4 is the lab's actual punchline: it looks like SSH, it isn't, and that's the point.