Skip to content

Every spawn launch fails on v0.129.0/v0.130.0: spored role policy rejected (MalformedPolicyDocument) #1069

Closed

Description

@scttfrdmn

Every spawn launch that sets up the spored instance role fails on v0.129.0 and v0.130.0, before any instance is created:

❌ Setting up IAM role
failed to attach policy to role: operation error IAM: PutRolePolicy, https response error StatusCode: 400,
RequestID: 53b1a502-b6e2-499c-b869-b6d4e989f393, MalformedPolicyDocument: The policy failed legacy parsing

Observed 2026-10-17 01:2x UTC with the released v0.130.0 CLI (spawn launch dnsctl-1300 --instance-type t3.micro --ttl 1h30m, account 435415984226). Both launches in the test failed the same way, and no instance was created. v0.128.2's last successful PutRolePolicy on spored-instance-role is in CloudTrail at 2026-10-16T15:59:28Z.

Cause. #905 (merged 2026-10-15, first released in v0.129.0) added the hybrid-registry statement with Resource: arn:aws:dynamodb:*:${aws:PrincipalAccount}:table/spawn-hybrid-registry (pkg/aws/iam.go sporedHybridRegistryResource). IAM does not accept ${aws:PrincipalAccount} as a policy variable there. Reproduced against PutRolePolicy on a throwaway role (spawn-iam-parse-probe-*, deleted afterwards):

document PutRolePolicy
sporedDCVRolePolicy as shipped MalformedPolicyDocument: The policy failed legacy parsing
same, with the literal account id OK
same, without the hybrid-registry statement OK

IAM Access Analyzer validate-policy reports no error, and simulate-custom-policy evaluates the shipped document as allowed. Only PutRolePolicy rejects it, so a pre-flight validation step would not have caught it either.

Blast radius. The statement is in sporedSelfManagementStatements, so all four writers carry it: SetupSporedIAMRole (every launch with no IAM flags), ensureSporedBaselinePolicy (CreateOrGetInstanceProfile), and createIAMRole / updateInlinePolicy (--iam-policy). pkg/launcher.Provision calls SetupSporedIAMRole, so lagotto and calque launches against these versions fail too. Only --instance-profile (which skips IAM setup) is unaffected.

Why CI was green. Substrate accepts the document; it doesn't model IAM's policy grammar.

Fix: bind the literal account ID at put time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions