Skip to content

Launch fails with IAM LimitExceeded: spored-policy-v1 written as an inline policy on the shared spored-instance-role overflows the 10,240-byte per-role inline quota #1567

Open

Description

@scttfrdmn

What happened (2026-11-09 ~02:18Z, us-east-1, spawn 0.161.0): a private-IP launch with SPAWN_BOOTSTRAP_EGRESS=proxy failed before reaching EC2.

✅ Setting up IAM role (1.3s)
⏳ Finding or creating the egress proxy...
❌ Error: failed to attach policy to role: attach spored-policy-v1 to spored-instance-role: operation error IAM: PutRolePolicy, https response error StatusCode: 409, ... LimitExceeded: Maximum policy size of 10240 bytes exceeded for role spored-instance-role

The same launch, with the same flags, had succeeded about 40 min earlier.

Cause, as far as I can see from the account:

  • spored-instance-role carries 13 inline policies, about 7.7 KB of minified JSON. They come from several unrelated workloads (for example calque-spike-access, microbiome-demo-*, omics-demo-*), presumably added through --iam-policy or --s3-read / --s3-write on various launches.
  • IAM caps the total size of a role's inline policies at 10,240 bytes. Once other launches have filled the role, the egress-proxy path's PutRolePolicy for spored-policy-v1 cannot fit, and every later launch that needs it fails.
  • spored-policy-v1 is not currently present as an inline policy on the role (GetRolePolicy returns NoSuchEntity), so the egress path keeps trying to re-add it.

Suggested fixes, any one of which would do:

  • (a) Make spored-policy-v1 a customer-managed policy, attached with AttachRolePolicy. Managed policies don't count toward the inline quota.
  • (b) Put per-launch grants (--s3-read / --s3-write / --iam-policy) on a per-launch role or managed policy, not inline on the shared role, so one user's history cannot break another's launches.
  • (c) At minimum, detect LimitExceeded and print what is filling the role, with the remedy.

I have not modified the role. It is shared, and the inline policies belong to other work.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions