Skip to content

Launch reports "spored never came up" when the caller merely lacks ssm:DescribeInstanceInformation (AccessDenied is polled as "not online yet") #1126

Closed

Description

@scttfrdmn

Found by running a real launch under exactly the docs' IAM baseline policy (spore-host/spore-host#585), with a throwaway role in the dev account.

What happened: spawn launch created the instance and then failed after the full timeout with:

instance i-… launched but spored never came up — it has NO TTL/idle safety net … SSM agent never came online (can't verify spored)

spored was fine. The caller's policy lacked ssm:DescribeInstanceInformation, and pkg/aws/ssm.go WaitForSSMOnlineProgress treats any error from that call as "not online yet":

out, err := ssmClient.DescribeInstanceInformation(ctx, ...)
if err != nil {
	return false
}

So an AccessDenied is polled until the deadline, then reported as the instance's fault, and the message tells the user their instance has no safety net. With the permission added, the same launch succeeded and verified spored.

Fix: treat an authorization error from DescribeInstanceInformation (and from the SendCommand/GetCommandInvocation probe after it) as terminal. Fail at once and name the missing action, e.g. "can't verify spored: your credentials lack ssm:DescribeInstanceInformation (see the IAM baseline); the instance itself may be fine". A test should pin that an AccessDenied from the SSM client returns immediately with that message, not after the timeout.

Related, smaller: under the same baseline, spawn doctor failed its "IAM instance-profile permission" check because it calls iam:ListInstanceProfiles, which launch never needs. The baseline now includes it so the doctor passes. But the check should probe what launch uses (iam:GetInstanceProfile on spored-instance-profile), or doctor will keep disagreeing with a launch that works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions