Skip to content

fix(ec2,ssm): echo IamInstanceProfile; gate SSM PingStatus on a profile (#331)#332

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/331-ssm-pingstatus-iam-profile
Jun 15, 2026
Merged

fix(ec2,ssm): echo IamInstanceProfile; gate SSM PingStatus on a profile (#331)#332
scttfrdmn merged 1 commit into
mainfrom
fix/331-ssm-pingstatus-iam-profile

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Two EC2/SSM fidelity gaps surfaced by spawn's warm-AMI SSM-readiness logic (spore-host/spawn#98, #181).

Gap #2DescribeInstances dropped IamInstanceProfile (Fixed)

RunInstances accepted and stored the profile, but the describe response had no field for it. Now the response includes iamInstanceProfile with arn and id, so a caller can read back the profile it attached. (Bare names are surfaced as a synthesized instance-profile/<name> ARN.)

Gap #1 — SSM DescribeInstanceInformation always reported Online (Changed)

Every running instance appeared with PingStatus=Online regardless of preconditions. In real AWS, SSM registration requires an IAM instance profile granting ssm:UpdateInstanceInformation, and an instance with no profile never registers. Now only running instances with a profile are listed — so callers can distinguish a dead instance (no profile → can never register) from an SSM-managed one.

Eligibility is profile presence (per the chosen approach): substrate doesn't model profile→policy attachment, and a missing profile is the actual dead-path signal the consumer tests. Time/agent-boot modeling is intentionally out of scope here.

Verification

  • TestEC2_DescribeInstances_EchoesIamInstanceProfile — with-profile echoes it, without-profile reports none.
  • TestSSM_DescribeInstanceInformation_RequiresProfile — end-to-end via a combined EC2+SSM server: profile-bearing instance is Online, profile-less instance never appears (dead path).

make test (race) + make lint clean. AWS shapes (iamInstanceProfile>arn/id, the SSM registration precondition) verified against the EC2/SSM API references.

Closes #331

…le (#331)

Two EC2/SSM fidelity gaps surfaced by spawn's warm-AMI SSM-readiness logic.

Gap 2 (Fixed): DescribeInstances dropped IamInstanceProfile. RunInstances already
stored it; the describe response now includes iamInstanceProfile {arn, id} so a
caller can read back the profile it set.

Gap 1 (Changed): DescribeInstanceInformation reported every running instance as
PingStatus=Online. Real SSM registration needs an IAM instance profile granting
ssm:UpdateInstanceInformation; an instance with no profile never registers. Now
only profile-bearing running instances are listed, so callers can distinguish a
'dead' instance (no profile) from an SSM-managed one. Eligibility = profile
presence (substrate does not model profile->policy attachment).

Tests: TestEC2_DescribeInstances_EchoesIamInstanceProfile and
TestSSM_DescribeInstanceInformation_RequiresProfile (end-to-end via a combined
EC2+SSM server). make test (race) + lint clean.

Closes #331
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn scttfrdmn merged commit 31028fd into main Jun 15, 2026
10 checks passed
@scttfrdmn scttfrdmn deleted the fix/331-ssm-pingstatus-iam-profile branch June 15, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSM/EC2 fidelity: every running instance reports PingStatus=Online; DescribeInstances drops IamInstanceProfile

1 participant