Skip to content

setup-dashboard-lambda-role.sh can't delete the legacy managed policy (multiple versions); the role keeps three now-redundant hand-added inline policies #1376

Closed

Description

@scttfrdmn

Found running the v0.147.0 script against production (2026-10-28).

  1. Legacy policy delete fails. The script detaches the legacy customer-managed SpawnDashboardLambdaPolicy and then calls delete-policy. That fails with DeleteConflict: This policy has more than one version (the live policy was at v9, with 4 non-default versions kept). The script falls back to 'delete it by hand'. I deleted the non-default versions and the policy by hand after confirming 0 attachments and saving the default document. The script should delete non-default versions (list-policy-versions + delete-policy-version) before delete-policy, so a re-run leaves no clutter.
  2. Redundant inline policies left on the role. SpawnDashboardLambdaRole still carries three hand-added inline policies that predate the script: DynamoDBStreamsAccess, SlackSecretsAccess and SporeSlackWorkspaceAccess. The script's SpawnDashboardLambdaPolicy / …Slack inline policies now cover what the code needs, so these are untracked grants. Two options: have the script own and remove them (after a coverage check like the one done for the legacy policy: every Allow pair checked against the new policy), or document them. Note that fix(bot): store chat-platform workspace credentials encrypted at rest #1320 changes the Slack workspace grants again.

Evidence: the before/after role snapshots and the dry run (a shim that records mutating calls) are described in the v0.147.0 deploy notes on #1371.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:spawntype:bugtype:infra

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions