Skip to content

Leave no trace: reap per-task spawn-instance-<hash> IAM roles and instance profiles once no instance uses them #1300

Closed

Description

@scttfrdmn

Split from #653. Owner principle (2026-10-24): anything spore.host creates, it removes once it is no longer needed (#610).

CreateOrGetInstanceProfile names a task's role and instance profile spawn-instance-<hash of the policy>. Every distinct set of input, output and results buckets mints a new pair, and nothing deletes them. A workflow fan-out across many bucket combinations accumulates roles towards the account quota (1,000 by default). Live example: the 2026-10-24 staging test created spawn-instance-af541989.

Proposal:

  • The reaper's sweep (or spawn cleanup) deletes a spawn-instance-* role and profile only when all of these hold:
    • it is tagged spawn:managed=true;
    • no instance in any covered region has that profile attached;
    • it is older than a grace period, e.g. 24 h, so a launch that is about to use it isn't raced.
  • Order: detach the profile, delete the inline policies, then delete the role and the profile.
  • Add it to spawn footprint, report it in the run summary, and give it its own report/reap switch (the same pattern as ElasticIps).
  • The IAM for this is provisioned by the reaper's own deploy paths and scoped to spawn-instance-*. The user creates none.

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