Skip to content

Launching roles (portal, sweep, CI smoke) can't write the lifecycle lease, so idle teardown never sees regional activity #1672

Open

Description

@scttfrdmn

Problem

After spawn setup-account (main, post-#1669) in dev 435415984226, the global lease scope is ACTIVE (epoch 1, written by the admin run). But the principals that actually launch spores there can't write spore-host-lifecycle. Simulated dynamodb:UpdateItem and dynamodb:ConditionCheckItem on arn:aws:dynamodb:us-east-1:435415984226:table/spore-host-lifecycle:

Role Lease write Defined in
OrganizationAccountAccessRole allowed (admin) —
SpawnSweepCrossAccountRole implicitDeny scripts/setup-sweep-cross-account-role.sh
spore-portal-launch implicitDeny spore-host/infra/tofu/portal-oidc/main.tf
spore-portal-e2e implicitDeny portal-oidc
GitHubActions-spawn-ts-live-smoke implicitDeny spawn-ts CI

Each launch path calls lifecyclemark.Mark (for example pkg/aws/client.go:663 and cmd/launch_sweep.go:1407). Without the grant the call fails silently, so regional scopes are never marked. The production reaper's account-idle sweep (v0.168.0, report mode) then logs lease unavailable … skipped for every region; first run 2026-11-20 20:31 UTC.

This fails safe: the account is never idle-torn-down. It also means leave-no-trace never fires for spores launched by the portal, sweeps or CI.

The dev account has no IAM groups or users, so the attach-group-policy hint from setup-account doesn't apply.

Fix

Have each role's provisioner attach arn:aws:iam::<acct>:policy/spore-host/spawn-user-lifecycle, or carry the same statement inline. Do this in the role's source, not out of band, so a re-apply doesn't drop it:

  • the sweep cross-account role script;
  • the portal-oidc Tofu (launch and e2e roles);
  • the spawn-ts smoke role.

Then confirm in report logs that the regional scopes go ACTIVE, then IDLE.

Do not grant it to anything tagged spore-host:role=service in infra 966362334030, since that account has no lease. Never anything touching 942542972736.

Related: #1666, #1669, #752.

Activity

  1. added this to the Leave no trace milestone on Nov 21, 2026
  2. added
    area:lifecycle
    on Nov 21, 2026
  3. scttfrdmn commented on Nov 25, 2026

    @scttfrdmn
    ContributorAuthor

    I traced the code each role in the table runs. None of the four calls lifecyclemark.Mark, so granting them the lease would add unused grants and would not make a regional scope go ACTIVE:

    • SpawnSweepCrossAccountRole: the sweep orchestrator never marks, by design. The CLI marks every sweep region and global before it invokes the orchestrator (cmd/launch_sweep.go:1407), and the reaper counts an unfinished sweep or schedule record as activity. An uncalled grant would also fail TestSweepCrossAccountRoleGrantsOnlyWhatTheOrchestratorCalls.
    • spore-portal-launch and spore-portal-e2e: both read-only by decision (SAM packages the entire CodeUri directory, so the ttl-reaper deploys at 75.7 MiB instead of ~7 MiB (and would ship .deploy-params.yaml) #645). They create nothing, and spore-host's iam-policy-source.test.ts fails on any write.
    • GitHubActions-spawn-ts-live-smoke: it launches through spawn-ts, which has no DynamoDB client and no lease code. The role also isn't codified anywhere.

    The dev regions are "lease unavailable" because no creator that marks has created there since v0.168.0. The launches there come from spawn-ts (live smoke, portal e2e setup) or from orchestrator sweeps.

    Follow-ups:

    Draft PR #1676:

    • spawn doctor's check now makes the mark's transaction (ConditionCheckItem plus UpdateItem). Before, it tried UpdateItem alone and passed an identity that could not mark.
    • The coverage gates now attribute a mark to the role that would run it.
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

    area:lifecyclecomponent:spawntype:bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions