Skip to content

Tag everything spawn creates spore-host:managed-by=spawn (incl. the spored policies) #1652

Closed

Description

@scttfrdmn

Part of the Leave-no-trace epic spore-host/spore-host#752. Design: every spore.host tool removes what it created once nothing it manages is active, after a 24 h grace. The rollout is report mode first, then reap. The boundary spore-host/spawn-instance-boundary is the only permanent piece. Account trust boundary: nothing in a spore.host account may reach 942542972736, so cleanup there is in-account only.

  • Add the libs/tags keys alongside spawn:managed.
  • The /spore-host/spored-* policies and the ISO-import role are untagged today; tag them.
  • Enable the untagged-create detector in unit tests.

Activity

  1. added this to the Leave no trace milestone on Nov 16, 2026
  2. scttfrdmn commented on Nov 16, 2026

    @scttfrdmn
    ContributorAuthor

    From calque#227 (spore-host/calque#233): a constraint for this issue's instance tags.

    calque launches its instances through pkg/aws.Launch and passes spore-host:managed-by=calque (plus the rest of the libs/tags set) in LaunchConfig.Tags. calque owns those instances' lifecycle: it terminates them, drains its fleets and deletes its pools. So calque is the right managed-by for them, and calque#228's cleanup will look for that value.

    In v0.131.0, buildTags (pkg/aws/tags.go) appends caller tags in Section 7 with appendTagUnique, and the first occurrence of a key wins. I checked this with a throwaway test against the v0.131.0 source: a caller spawn:managed=false is dropped, and a caller spore-host:managed-by=calque survives, only because spawn writes no spore-host:* key itself today.

    If this issue adds spore-host:managed-by=spawn in sections 1 to 6, every calque (and lagotto snipe?) instance will be silently re-labelled spawn. spawn's idle teardown would then count them as its own, and calque's would miss them. Suggest one of:

    • write spawn's spore-host:* keys only when the caller didn't supply them (for example, add them after Section 7 with appendTagUnique); or
    • add a LaunchConfig.ManagedBy tags.Tool field, defaulting to spawn.

    Same for buildIAMTags. It mutates the caller's IAMRoleConfig.Tags map and sets keys unconditionally. calque re-applies its tags with TagRole after CreateOrGetInstanceProfile, so roles self-correct, but a "don't overwrite a caller's spore-host:managed-by" rule there would avoid the round trip.

    TTL enforcement should keep keying on the spawn:* lifecycle tags, not on managed-by. calque's instances still rely on spawn's TTL backstop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:spawnenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions